mirror of
https://github.com/p-stream/p-stream.git
synced 2026-05-07 14:39:46 +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 {
|
||||
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__);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue