Skip to content

Commit

Permalink
Commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
armup31 committed Nov 22, 2024
1 parent 7444c48 commit 1a1f9e6
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions websites/P/Physics Wallah/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ presence.on("UpdateData", async () => {
startTimestamp: browsingTimestamp,
type: ActivityType.Watching,
},
{ pathname } = document.location,
fullurl = document.URL,
{ pathname, href } = document.location,
fullurl = href,
privacyMode = await presence.getSetting<boolean>("privacy");

if (pathname === "/") {
Expand Down Expand Up @@ -67,28 +67,24 @@ presence.on("UpdateData", async () => {
presenceData.smallImageText = "Paused";
}
} else if (fullurl.includes("subject-topics")) {
const details = JSON.parse(localStorage.getItem("SCHEDULE_DETAILS"));
if (fullurl.includes("chapterId")) {
presenceData.details = JSON.parse(
localStorage.getItem("SCHEDULE_DETAILS")
).tags[0];
presenceData.state = JSON.parse(
localStorage.getItem("SCHEDULE_DETAILS")
).subject.name;
presenceData.details = details.tags[0];
presenceData.state = details.subject.name;
presenceData.smallImageKey = Assets.Reading;
presenceData.smallImageText = "Browsing Resources";
} else if (!fullurl.includes("chapterId")) {
presenceData.details = JSON.parse(
localStorage.getItem("SCHEDULE_DETAILS")
).subject.name;
presenceData.details = details.subject.name;
presenceData.state = "Browsing Resources...";
presenceData.smallImageKey = Assets.Reading;
presenceData.smallImageText = "Browsing Resources";
}
} else if (fullurl.includes("open-pdf")) {
if (localStorage.getItem("dpp_subject")) {
const dpp_subject = localStorage.getItem("dpp_subject");

Check failure on line 83 in websites/P/Physics Wallah/presence.ts

View workflow job for this annotation

GitHub Actions / Compile and Lint

Identifier 'dpp_subject' is not in camel case
if (dpp_subject) {

Check failure on line 84 in websites/P/Physics Wallah/presence.ts

View workflow job for this annotation

GitHub Actions / Compile and Lint

Identifier 'dpp_subject' is not in camel case
presenceData.details = "Solving DPP (PDF)";
if (!privacyMode)
presenceData.state = localStorage.getItem("dpp_subject");
presenceData.state = dpp_subject;

Check failure on line 87 in websites/P/Physics Wallah/presence.ts

View workflow job for this annotation

GitHub Actions / Compile and Lint

Identifier 'dpp_subject' is not in camel case
else presenceData.state = "Improving skills";

presenceData.startTimestamp = browsingTimestamp;
Expand All @@ -106,15 +102,14 @@ presence.on("UpdateData", async () => {
presenceData.smallImageText = "Viewing DPP";
}
} else if (pathname.startsWith("/watch")) {
const deta = JSON.parse(localStorage.getItem("SCHEDULE_DETAILS")).subject
.name;
let detal = ` | ${deta}`;
if (deta === null) detal = "";
const deta = JSON.parse(localStorage.getItem("SCHEDULE_DETAILS"));
let detal = ` | ${deta.subject}`;
if (deta.subject === null) detal = "";
if (!privacyMode) {
presenceData.details = `Watching Lecture${detal}`;

presenceData.state = `${
JSON.parse(localStorage.getItem("SCHEDULE_DETAILS")).topic
deta.topic
}`;

presenceData.buttons = [{ label: "Watch Lecture", url: fullurl }];
Expand Down

0 comments on commit 1a1f9e6

Please sign in to comment.