fix(ios): no permission warning

See-also #9002
This commit is contained in:
Andelf
2023-04-04 10:39:51 +08:00
committed by Tienson Qin
parent ff04cc2009
commit 8edaa256db
2 changed files with 11 additions and 1 deletions

View File

@@ -41,7 +41,8 @@
[frontend.util.persist-var :as persist-var]
[goog.object :as gobj]
[lambdaisland.glogi :as log]
[promesa.core :as p]))
[promesa.core :as p]
[frontend.mobile.core :as mobile]))
(defn set-global-error-notification!
[]
@@ -216,6 +217,8 @@
(events/run!)
(p/do!
(when (mobile-util/native-platform?)
(mobile/mobile-preinit))
(-> (p/let [repos (get-repos)
_ (state/set-repos! repos)
_ (restore-and-setup! repos)]

View File

@@ -21,6 +21,13 @@
(def *last-shared-url (atom nil))
(def *last-shared-seconds (atom 0))
(defn mobile-preinit
"preinit logic of mobile platforms: setup document folder permission"
[]
(when (mobile-util/native-ios?)
;; Caution: This must be called before any file accessing
(capacitor-fs/ios-ensure-documents!)))
(defn- ios-init
"Initialize iOS-specified event listeners"
[]