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__); }