From c007dbe5dcc4a5477e03cad35e5128ded8c68ad6 Mon Sep 17 00:00:00 2001 From: Cas_ <6506529+ThaUnknown@users.noreply.github.com> Date: Tue, 1 Sep 2026 22:48:09 +0200 Subject: [PATCH] WebPWA: Fix duplicate notification count inside icon (#4571) --- src/Vencord.ts | 1 - src/fixWeirdAppRegionBug.css | 4 ---- src/plugins/webPWA.browser/index.tsx | 4 +++- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 src/fixWeirdAppRegionBug.css diff --git a/src/Vencord.ts b/src/Vencord.ts index 17790136d..21d81f75f 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -18,7 +18,6 @@ // DO NOT REMOVE UNLESS YOU WISH TO FACE THE WRATH OF THE CIRCULAR DEPENDENCY DEMON!!!!!!! import "~plugins"; -import "./fixWeirdAppRegionBug.css"; export * as Api from "./api"; export * as Plugins from "./api/PluginManager"; diff --git a/src/fixWeirdAppRegionBug.css b/src/fixWeirdAppRegionBug.css deleted file mode 100644 index bb4bb663e..000000000 --- a/src/fixWeirdAppRegionBug.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Works around a very strange issue where *something* (electron?) will inject body { app-region: drag } when using online themes */ -body { - app-region: no-drag; -} \ No newline at end of file diff --git a/src/plugins/webPWA.browser/index.tsx b/src/plugins/webPWA.browser/index.tsx index 94ec9d491..452d2c6f4 100644 --- a/src/plugins/webPWA.browser/index.tsx +++ b/src/plugins/webPWA.browser/index.tsx @@ -26,6 +26,8 @@ function colorToHex(color: string) { return "#" + [...ctx.getImageData(0, 0, 1, 1).data.slice(0, 3)].map(n => n.toString(16).padStart(2, "0")).join(""); } +const icon = "https://discord.com/assets/favicon.ico"; + let linkEl: HTMLLinkElement | undefined; async function setManifest() { // need to wait for CSS changes to flush @@ -38,7 +40,6 @@ async function setManifest() { const endpoint = "https:" + window.GLOBAL_ENV.WEBAPP_ENDPOINT; const appUrl = endpoint + "/app"; // URL when PWA launches - const icon = document.querySelector('link[rel="icon"]')!.href; const styles = getComputedStyle(document.body); const manifest = { id: appUrl, @@ -122,6 +123,7 @@ export default definePlugin({ NotificationSettingsStore.addChangeListener(this.setBadge); GuildReadStateStore.addChangeListener(this.setBadge); RelationshipStore.addChangeListener(this.setBadge); + this.setBadge(); if (!IS_USERSCRIPT) { // keybinds