enhance(iOS): refresh when launching/switching app

pull/3651/head^2
leizhe 2022-01-05 18:42:40 +08:00 committed by Andelf
parent 55fdfa6ae9
commit cdfe9f5ccc
1 changed files with 12 additions and 2 deletions

View File

@ -6,7 +6,11 @@
[reitit.frontend.easy :as rfe] [reitit.frontend.easy :as rfe]
[clojure.string :as string] [clojure.string :as string]
[frontend.handler.notification :as notification] [frontend.handler.notification :as notification]
[frontend.fs.capacitor-fs :as fs])) [frontend.fs.capacitor-fs :as fs]
[frontend.handler.page :as page-handler]
[frontend.modules.shortcut.core :as shortcut]
[frontend.components.repo :as repo]
[frontend.handler.web.nfs :as nfs-handler]))
(defn init! (defn init!
[] []
@ -39,4 +43,10 @@
(.addListener Keyboard "keyboardWillShow" (.addListener Keyboard "keyboardWillShow"
#(state/pub-event! [:mobile/keyboard-will-show])) #(state/pub-event! [:mobile/keyboard-will-show]))
(.addListener Keyboard "keyboardDidShow" (.addListener Keyboard "keyboardDidShow"
#(state/pub-event! [:mobile/keyboard-did-show])))) #(state/pub-event! [:mobile/keyboard-did-show]))
(.addListener App "appStateChange"
#(let [repo (state/get-current-repo)]
(nfs-handler/refresh! repo repo/refresh-cb)
;; (notification/show! "Notes updated!" :success true)
))))