3 fixes where global-config as incorrectly called for non desktop

These issues were introduced with #6531. The global-config component
should not be called if not in a supported platform. This fixes
re-index, switching graphs and editing config.edn for mobile.  Switching
graphs was partially fixed in #6664 but didn't address the root cause
which is the global-handler component shouldn't be called if not enabled
for a platform
This commit is contained in:
Gabriel Horner
2022-09-12 21:41:15 -04:00
committed by Andelf
parent a790146804
commit f157490d61
4 changed files with 22 additions and 19 deletions

View File

@@ -338,14 +338,16 @@
(fn [path handle]
(when nfs?
(swap! path-handles assoc path handle))))
global-dir (global-config-handler/global-config-dir)
global-files-result (if (config/global-config-enabled?)
(fs/get-files global-dir (constantly nil))
[])
new-local-files (-> (->db-files mobile-native? electron? dir-name local-files-result)
(remove-ignore-files dir-name nfs?))
new-global-files (-> (->db-files mobile-native? electron? global-dir global-files-result)
(remove-ignore-files global-dir nfs?))
new-global-files (if (config/global-config-enabled?)
(p/let [global-files-result (fs/get-files
(global-config-handler/global-config-dir)
(constantly nil))
global-files (-> (->db-files mobile-native? electron? (global-config-handler/global-config-dir) global-files-result)
(remove-ignore-files (global-config-handler/global-config-dir) nfs?))]
global-files)
(p/resolved []))
new-files (concat new-local-files new-global-files)
_ (when nfs?