Browse Source

fix: UI not refreshed on iOS

Tienson Qin 3 years ago
parent
commit
8915818c3f
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/main/frontend/handler/file.cljs

+ 6 - 6
src/main/frontend/handler/file.cljs

@@ -119,19 +119,19 @@
                  (db/set-file-content! repo path content opts))]
                  (db/set-file-content! repo path content opts))]
     (util/p-handle (write-file!)
     (util/p-handle (write-file!)
                    (fn [_]
                    (fn [_]
+                     (when re-render-root? (ui-handler/re-render-root!))
+
                      (cond
                      (cond
+                       (= path (config/get-custom-css-path repo))
+                       (ui-handler/add-style-if-exists!)
+
                        (= path (config/get-repo-config-path repo))
                        (= path (config/get-repo-config-path repo))
                        (p/let [_ (repo-config-handler/restore-repo-config! repo content)]
                        (p/let [_ (repo-config-handler/restore-repo-config! repo content)]
                          (state/pub-event! [:shortcut/refresh]))
                          (state/pub-event! [:shortcut/refresh]))
 
 
                        (and (config/global-config-enabled?) (= path (global-config-handler/global-config-path)))
                        (and (config/global-config-enabled?) (= path (global-config-handler/global-config-path)))
                        (p/let [_ (global-config-handler/restore-global-config!)]
                        (p/let [_ (global-config-handler/restore-global-config!)]
-                         (state/pub-event! [:shortcut/refresh]))
-
-                       (= path (config/get-custom-css-path repo))
-                       (ui-handler/add-style-if-exists!))
-
-                     (when re-render-root? (ui-handler/re-render-root!)))
+                         (state/pub-event! [:shortcut/refresh]))))
                    (fn [error]
                    (fn [error]
                      (when (and (config/global-config-enabled?)
                      (when (and (config/global-config-enabled?)
                                 (= path (global-config-handler/global-config-path)))
                                 (= path (global-config-handler/global-config-path)))