Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
Update desktop app detection
Browse files Browse the repository at this point in the history
  • Loading branch information
IzKuipers committed Jul 24, 2023
1 parent 89077e6 commit e4f0faf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/Apps/Settings/Pages/About/SystemSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -48,7 +49,7 @@
</div>
<div class="row">
<div class="key">ArcOS Mode</div>
<div class="value">{isDesktop ? "Desktop app" : "Browser"}</div>
<div class="value">{desktopApp ? "Desktop app" : "Browser"}</div>
</div>
</Section>
{/if}
2 changes: 2 additions & 0 deletions src/ts/desktop/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit e4f0faf

Please sign in to comment.