desktop app windows
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const getPlatform = () => {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
const isTauri = !!(window as any).__TAURI_INTERNALS__;
|
||||
|
||||
if (isTauri) {
|
||||
if (userAgent.includes("android")) return "android";
|
||||
if (userAgent.includes("iphone") || userAgent.includes("ipad"))
|
||||
return "ios";
|
||||
return "desktop";
|
||||
}
|
||||
return "web";
|
||||
};
|
||||
|
||||
export const isDesktop = getPlatform() === "desktop";
|
||||
export const isMobile = ["android", "ios"].includes(getPlatform());
|
||||
export const isAndroid = getPlatform() === "android";
|
||||
export const isWeb = getPlatform() === "web";
|
||||
Reference in New Issue
Block a user