diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index b5841883bd..91f4d6606f 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -31,7 +31,7 @@ html meta(name='theme-color-orig' content= themeColor || '#31748f') meta(property='twitter:card' content='summary') meta(property='og:site_name' content= instanceName || 'Calckey') - meta(name='viewport' content='width=device-width, initial-scale=1') + meta(name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no') link(rel='icon' href= icon || `/favicon.ico?${ timestamp }`) link(rel='apple-touch-icon' href= icon || `/apple-touch-icon.png?${ timestamp }`) link(rel='manifest' href='/manifest.json') diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 43a92a3163..7a004688d6 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -104,17 +104,6 @@ import { getAccountFromId } from "@/scripts/get-account-from-id"; }); //#endregion - // If mobile, insert the viewport meta tag - if (["smartphone", "tablet"].includes(deviceKind)) { - const viewport = document.getElementsByName("viewport").item(0); - viewport.setAttribute( - "content", - `${viewport.getAttribute( - "content", - )}, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover`, - ); - } - //#region Set lang attr const html = document.documentElement; html.setAttribute("lang", lang); @@ -311,12 +300,11 @@ import { getAccountFromId } from "@/scripts/get-account-from-id"; if (ColdDeviceStorage.get("syncDeviceDarkMode")) { defaultStore.set("darkMode", isDeviceDarkmode()); } - - window.matchMedia("(prefers-color-scheme: dark)").addListener((mql) => { + window.matchMedia("(prefers-color-scheme: dark)").onchange = (mql) => { if (ColdDeviceStorage.get("syncDeviceDarkMode")) { defaultStore.set("darkMode", mql.matches); } - }); + }; //#endregion fetchInstanceMetaPromise.then(() => { diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 5b61c1b2c8..3784ef8af3 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -15,10 +15,7 @@ :style="{ background: pageMetadata?.value?.bg }" @contextmenu.stop="onContextmenu" > -