Skip to content

Commit

Permalink
fix a small issue
Browse files Browse the repository at this point in the history
  • Loading branch information
armup31 committed Oct 10, 2024
1 parent ba6c5a9 commit 7e71f18
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions websites/P/Physics Wallah/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ presence.on("UpdateData", async () => {
} else if (pathname.includes("batch-video-player")) {
const deta = localStorage.getItem("dpp_subject");
let detal = ` | ${deta}`;
if (deta === null) detal = "";
if (!privacyMode) {
if (deta === null) detal = "";
presenceData.details = `Watching Lecture${detal}`;

presenceData.state = `${
Expand All @@ -57,11 +57,11 @@ presence.on("UpdateData", async () => {
presenceData.buttons = [{ label: "Watch Lecture", url: href }];
} else presenceData.details = `Watching a lecture${detal}`;

[presenceData.startTimestamp, presenceData.endTimestamp] =
updateVideoTimestamps();
if (document.querySelectorAll(".vjs-paused").length < 1) {
presenceData.smallImageKey = Assets.Play;
presenceData.smallImageText = "Watching a lecture";
[presenceData.startTimestamp, presenceData.endTimestamp] =
updateVideoTimestamps();
} else {
presenceData.smallImageKey = Assets.Pause;
presenceData.smallImageText = "Paused";
Expand Down Expand Up @@ -104,9 +104,8 @@ presence.on("UpdateData", async () => {
} else if (pathname.startsWith("/watch")) {
const deta = localStorage.getItem("dpp_subject");
let detal = ` | ${deta}`;
if (deta === null) detal = "";
if (!privacyMode) {
if (deta === null) detal = "";

presenceData.details = `Watching Lecture${detal}`;

presenceData.state = `${
Expand All @@ -116,12 +115,11 @@ presence.on("UpdateData", async () => {
presenceData.buttons = [{ label: "Watch Lecture", url: href }];
} else presenceData.details = `Watching a lecture${detal}`;

[presenceData.startTimestamp, presenceData.endTimestamp] =
updateVideoTimestamps();

if (document.querySelectorAll(".vjs-paused").length < 1) {
presenceData.smallImageKey = Assets.Play;
presenceData.smallImageText = "Watching a lecture";
[presenceData.startTimestamp, presenceData.endTimestamp] =
updateVideoTimestamps();
} else {
presenceData.smallImageKey = Assets.Pause;
presenceData.smallImageText = "Paused";
Expand Down

0 comments on commit 7e71f18

Please sign in to comment.