feat(android): enable write/refresh files when switching apps (#3957)

feat(android): enable write/refresh files when switch apps
pull/3997/head
llcc 2022-01-23 12:53:40 +08:00 committed by GitHub
parent 5e92cec2d9
commit d3757b6b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -42,10 +42,14 @@
(println "iOS container path: " path))
;; Keyboard watcher
(.addListener Keyboard "keyboardWillShow"
#(state/pub-event! [:mobile/keyboard-will-show]))
;; (.addListener Keyboard "keyboardDidShow"
;; #(state/pub-event! [:mobile/keyboard-did-show]))
;; (.addListener Keyboard "keyboardWillShow"
;; #(state/pub-event! [:mobile/keyboard-will-show]))
(.addListener Keyboard "keyboardDidShow"
#(state/pub-event! [:mobile/keyboard-did-show])))
(when (mobile-util/is-native-platform?)
(.addEventListener js/window "statusTap"
#(util/scroll-to-top true))
(.addListener App "appStateChange"
(fn [^js state]
@ -54,8 +58,4 @@
(if is-active?
(p/do! (nfs-handler/refresh! repo repo/refresh-cb)
(notification/show! "Notes updated!" :success true))
(editor-handler/save-current-block!)))))))
(when (mobile-util/is-native-platform?)
(.addEventListener js/window "statusTap"
#(util/scroll-to-top true))))
(editor-handler/save-current-block!))))))))