mirror of
https://github.com/p-stream/p-stream.git
synced 2026-05-12 14:00:58 +00:00
Update useIsDesktopApp.ts
This commit is contained in:
parent
be36a43100
commit
949b1081f7
1 changed files with 9 additions and 2 deletions
|
|
@ -1,3 +1,10 @@
|
||||||
export function useIsDesktopApp(): boolean {
|
// Desktop app is detected via a global set by the Electron preload script.
|
||||||
return navigator.userAgent.includes("P-Stream/");
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
__PSTREAM_DESKTOP__?: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useIsDesktopApp(): boolean {
|
||||||
|
return Boolean(window.__PSTREAM_DESKTOP__);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue