From e4f0faf42cb7978cc3b0875dab53baef1eb862e4 Mon Sep 17 00:00:00 2001 From: Izaak Kuipers Date: Mon, 24 Jul 2023 19:22:08 +0200 Subject: [PATCH] Update desktop app detection --- src/lib/Apps/Settings/Pages/About/SystemSection.svelte | 7 ++++--- src/ts/desktop/app.ts | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/Apps/Settings/Pages/About/SystemSection.svelte b/src/lib/Apps/Settings/Pages/About/SystemSection.svelte index 9252d9a8..b89377b9 100644 --- a/src/lib/Apps/Settings/Pages/About/SystemSection.svelte +++ b/src/lib/Apps/Settings/Pages/About/SystemSection.svelte @@ -5,13 +5,14 @@ import { getDeviceInfo } from "../../../../../ts/device/main"; import { formatBytes } from "../../../../../ts/api/fs/sizes"; import { createOverlayableError } from "../../../../../ts/errorlogic/overlay"; + import { isDesktop } from "../../../../../ts/desktop/app"; let deviceInfo: DeviceInfo; - let isDesktop = false; + let desktopApp = false; onMount(async () => { deviceInfo = await getDeviceInfo(); - /* isTauri = await inTauri(); */ + desktopApp = isDesktop(); }); function ramInfo() { @@ -48,7 +49,7 @@
ArcOS Mode
-
{isDesktop ? "Desktop app" : "Browser"}
+
{desktopApp ? "Desktop app" : "Browser"}
{/if} diff --git a/src/ts/desktop/app.ts b/src/ts/desktop/app.ts index abf8c4e9..f27e7e2a 100644 --- a/src/ts/desktop/app.ts +++ b/src/ts/desktop/app.ts @@ -5,6 +5,8 @@ export async function getDesktopMode() { const req = await (await fetch("./desktop")).text(); DESKTOP_MODE = req.includes("desktop") ? "desktop" : "browser"; + + console.log(DESKTOP_MODE); } catch { DESKTOP_MODE = "browser"; }