Prechádzať zdrojové kódy

fix: check ios? before forcing private part

Tienson Qin 3 rokov pred
rodič
commit
bb829f227b

+ 1 - 1
src/main/frontend/components/onboarding/setups.cljs

@@ -44,7 +44,7 @@
   [:div.mobile-intro
    (cond
      (mobile-util/native-android?)
-     [:div
+     [:div.px-4
       "You can save them in your local storage, and use Logseq Sync or any third-party sync service to keep your notes sync with other devices. "
       "If you prefer to use Dropbox to sync your notes, you can use "
       [:a {:href "https://play.google.com/store/apps/details?id=com.ttxapps.dropsync"

+ 14 - 12
src/main/frontend/fs/capacitor_fs.cljs

@@ -216,20 +216,22 @@
 (defn ios-force-include-private
   "iOS sometimes return paths without the private part."
   [path]
-  (cond
-    (string/includes? path "///private/")
-    path
+  (if (mobile-util/native-ios?)
+    (cond
+      (string/includes? path "///private/")
+      path
 
-    (string/includes? path "///")
-    (let [[prefix others] (string/split path "///")]
-      (str prefix "///private/" others))
+      (string/includes? path "///")
+      (let [[prefix others] (string/split path "///")]
+        (str prefix "///private/" others))
 
-    :else
-    (do
-      (state/pub-event! [:instrument {:type :error/ios-path-missing-slashes
-                                      ;; respect user's privacy
-                                      :path (gp-util/safe-subs path 10)}])
-      path)))
+      :else
+      (do
+        (state/pub-event! [:instrument {:type :error/ios-path-missing-slashes
+                                        ;; respect user's privacy
+                                        :path (gp-util/safe-subs path 10)}])
+        path))
+    path))
 
 (defn normalize-file-protocol-path [dir path]
   (let [dir             (some-> dir (string/replace #"/+$" ""))