Fix the mechanical style rules. [skip build]
This commit is contained in:
+18
-18
@@ -1,3 +1,21 @@
|
||||
/**
|
||||
* Check if we're running inside Electron (not Tauri)
|
||||
*/
|
||||
export const isElectron = (): boolean => typeof window !== 'undefined' && 'electron' in window;
|
||||
|
||||
/**
|
||||
* Check if we're running inside a Capacitor native app
|
||||
*/
|
||||
export const isCapacitorNative = (): boolean => {
|
||||
if (typeof window === 'undefined') return false;
|
||||
const cap = (window as any).Capacitor;
|
||||
return Boolean(
|
||||
cap?.isNativePlatform?.() ||
|
||||
cap?.getPlatform?.() === 'android' ||
|
||||
cap?.getPlatform?.() === 'ios',
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Open an external URL using Electron's shell.openExternal, or window.open in browser
|
||||
* @param url The URL to open
|
||||
@@ -174,24 +192,6 @@ export const setupNotificationTapListener = async (
|
||||
*/
|
||||
export const isTauri = (): boolean => '__TAURI__' in window || '__TAURI_INTERNALS__' in window;
|
||||
|
||||
/**
|
||||
* Check if we're running inside Electron (not Tauri)
|
||||
*/
|
||||
export const isElectron = (): boolean => typeof window !== 'undefined' && 'electron' in window;
|
||||
|
||||
/**
|
||||
* Check if we're running inside a Capacitor native app
|
||||
*/
|
||||
export const isCapacitorNative = (): boolean => {
|
||||
if (typeof window === 'undefined') return false;
|
||||
const cap = (window as any).Capacitor;
|
||||
return Boolean(
|
||||
cap?.isNativePlatform?.() ||
|
||||
cap?.getPlatform?.() === 'android' ||
|
||||
cap?.getPlatform?.() === 'ios',
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if we're running on a mobile platform (Android/iOS)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user