Skip to content

Commit

Permalink
some upgrades
Browse files Browse the repository at this point in the history
some improvments
  • Loading branch information
trains2050 committed Feb 21, 2021
1 parent 42b6601 commit e3bcbf6
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions websites/M/MKPC/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const presence = new Presence({
browsingStamp = Math.floor(Date.now() / 1000);

let user;

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "logo"
Expand All @@ -27,17 +26,10 @@ presence.on("UpdateData", async () => {
if (elt) {
const lap = elt.innerText.replace(/.+? /g, "");
presenceData.details = "Currently playing: Lap " + lap;
} else if (document.location.pathname.includes("/profil.php")) {
presenceData.startTimestamp = browsingStamp;
user = document.querySelector(
"html > body > main > h1"
);
presenceData.details = "Viewing: " + user.innerText;
presenceData.smallImageKey = "search";
} else if (document.location.pathname == "/mariokart.php") {
presenceData.startTimestamp = browsingStamp;
presenceData.details = "Playing the core game";
presenceData.smallImageKey = "wheel";
presenceData.details = "browsing map's";
presenceData.smallImageKey = "search";
} else if (document.location.pathname == "/category.php") {
presenceData.startTimestamp = browsingStamp;
user = document.querySelector(
Expand All @@ -52,8 +44,14 @@ presence.on("UpdateData", async () => {
);
presenceData.details = "Viewing: " + user.innerText;
presenceData.smallImageKey = "search";
}
if (presenceData.details == null) {
} else if (document.location.pathname == "/profil.php") {
presenceData.startTimestamp = browsingStamp;
user = document.querySelector(
"html > body > main > h1"
);
presenceData.details = "Viewing: " + user.innerText;
presenceData.smallImageKey = "search";
} if (presenceData.details == null) {
presence.setTrayTitle();
presence.setActivity();
} else {
Expand Down

0 comments on commit e3bcbf6

Please sign in to comment.