From 949b1081f7bc7dca1025b449ca4acce42b090e21 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Mon, 2 Feb 2026 11:22:24 -0700 Subject: [PATCH] Update useIsDesktopApp.ts --- src/hooks/useIsDesktopApp.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hooks/useIsDesktopApp.ts b/src/hooks/useIsDesktopApp.ts index e801fca7..6245cf3d 100644 --- a/src/hooks/useIsDesktopApp.ts +++ b/src/hooks/useIsDesktopApp.ts @@ -1,3 +1,10 @@ -export function useIsDesktopApp(): boolean { - return navigator.userAgent.includes("P-Stream/"); +// Desktop app is detected via a global set by the Electron preload script. +declare global { + interface Window { + __PSTREAM_DESKTOP__?: boolean; + } +} + +export function useIsDesktopApp(): boolean { + return Boolean(window.__PSTREAM_DESKTOP__); }