|
@@ -216,20 +216,22 @@
|
|
|
(defn ios-force-include-private
|
|
(defn ios-force-include-private
|
|
|
"iOS sometimes return paths without the private part."
|
|
"iOS sometimes return paths without the private part."
|
|
|
[path]
|
|
[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]
|
|
(defn normalize-file-protocol-path [dir path]
|
|
|
(let [dir (some-> dir (string/replace #"/+$" ""))
|
|
(let [dir (some-> dir (string/replace #"/+$" ""))
|