about summary refs log tree commit diff
path: root/src/alf/util/platform.ts
diff options
context:
space:
mode:
authorMinseo Lee <itoupluk427@gmail.com>2024-02-29 09:51:56 +0900
committerGitHub <noreply@github.com>2024-02-29 09:51:56 +0900
commita1127bfcfc7ad080a5bd6210c6561788f1643db8 (patch)
treef2280d0308e4fc979f59f4f7abe3ef31a86390a2 /src/alf/util/platform.ts
parentb723c4ca7ce22f673ea60e119da8552c452741da (diff)
parent7fd13cacfea4e9e4609ac2cfa11749544fc2f8f8 (diff)
downloadvoidsky-a1127bfcfc7ad080a5bd6210c6561788f1643db8.tar.zst
Merge branch 'main' into patch-3
Diffstat (limited to 'src/alf/util/platform.ts')
-rw-r--r--src/alf/util/platform.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/alf/util/platform.ts b/src/alf/util/platform.ts
index 544f5480b..294e08a8b 100644
--- a/src/alf/util/platform.ts
+++ b/src/alf/util/platform.ts
@@ -1,25 +1,25 @@
-import {Platform} from 'react-native'
+import {isAndroid, isIOS, isNative, isWeb} from 'platform/detection'
 
 export function web(value: any) {
-  return Platform.select({
-    web: value,
-  })
+  if (isWeb) {
+    return value
+  }
 }
 
 export function ios(value: any) {
-  return Platform.select({
-    ios: value,
-  })
+  if (isIOS) {
+    return value
+  }
 }
 
 export function android(value: any) {
-  return Platform.select({
-    android: value,
-  })
+  if (isAndroid) {
+    return value
+  }
 }
 
 export function native(value: any) {
-  return Platform.select({
-    native: value,
-  })
+  if (isNative) {
+    return value
+  }
 }