mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 17:06:23 +00:00
fix: check ios? before forcing private part
This commit is contained in:
@@ -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 #"/+$" ""))
|
||||
|
||||
Reference in New Issue
Block a user