Просмотр исходного кода

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

feat(android): enable write/refresh files when switch apps
llcc 3 лет назад
Родитель
Сommit
d3757b6b3c
1 измененных файлов с 9 добавлено и 9 удалено
  1. 9 9
      src/main/frontend/mobile/core.cljs

+ 9 - 9
src/main/frontend/mobile/core.cljs

@@ -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!))))))))