From 52ec6dbe4ee9eb189cbd02db92ec3fc47deba5c4 Mon Sep 17 00:00:00 2001 From: wont-stream <143244075+wont-stream@users.noreply.github.com> Date: Sun, 6 Apr 2025 21:37:40 -0400 Subject: [PATCH] dont format the entire file --- public/js/index.js | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 573e6a5..a9ad378 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -108,6 +108,7 @@ if (userId && instanceUri) { socket.addEventListener("message", (event) => { const payload = JSON.parse(event.data); + if (payload.op === 1) { setInterval(() => { socket.send( @@ -166,10 +167,10 @@ function buildActivityHTML(activity) { start && progress === null ? `
Since: ${new Date(start).toLocaleTimeString("en-GB", { - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - })} + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + })}
` : ""; @@ -177,23 +178,23 @@ function buildActivityHTML(activity) { activity.buttons && activity.buttons.length > 0 ? `
${activity.buttons - .map((button, index) => { - const label = - typeof button === "string" - ? button - : button.label; - let url = null; - if (typeof button === "object" && button.url) { - url = button.url; - } else if (index === 0 && activity.url) { - url = activity.url; - } - return url - ? `${label}` - : null; - }) - .filter(Boolean) - .join("")} + .map((button, index) => { + const label = + typeof button === "string" + ? button + : button.label; + let url = null; + if (typeof button === "object" && button.url) { + url = button.url; + } else if (index === 0 && activity.url) { + url = activity.url; + } + return url + ? `${label}` + : null; + }) + .filter(Boolean) + .join("")}
` : "";