Browse Source

fix: util/web-platform? is not a function

Tienson Qin 1 month ago
parent
commit
59f75319b8

+ 2 - 0
prompts/review.md

@@ -9,3 +9,5 @@ You're Clojure(script) expert, you're responsible to check those common errors:
 - Recommended to *avoid* using `memoize`, especially when the memoized function's parameters include `entity` or `block` or `conn` or `db`. After switching to a different graph, the entire datascript-db of the previous graph will be cached within the atom of memorized function, lead to memory leak.
 
 - Avoid using `dorun` to execute side effects; `doseq` is recommended.
+
+- `util/web-platform?` is a not a function.

+ 1 - 1
src/main/frontend/db/persist.cljs

@@ -11,7 +11,7 @@
 
 (defn get-all-graphs
   []
-  (p/let [idb-repos (when-not (or (util/web-platform?) (util/mobile?))
+  (p/let [idb-repos (when-not (or util/web-platform? (util/mobile?))
                       (idb/get-nfs-dbs))
           repos (persist-db/<list-db)
           repos' (map

+ 1 - 1
src/main/frontend/fs/sync.cljs

@@ -3213,7 +3213,7 @@
 (defn <sync-start
   []
   (go
-    (when-not (or @*sync-starting (util/mobile?) (util/web-platform?))
+    (when-not (or @*sync-starting (util/mobile?) util/web-platform?)
       (reset! *sync-starting true)
       (if-not (and (<! (<should-start-sync?))
                    (<! (<connectivity-testing)))

+ 1 - 1
src/main/frontend/handler/events/ui.cljs

@@ -318,7 +318,7 @@
   (state/set-state! [:ui/loading? :login] false)
   (async/go
     (let [result (async/<! (sync/<user-info sync/remoteapi))
-          mobile-or-web? (or (util/mobile?) (util/web-platform?))]
+          mobile-or-web? (or (util/mobile?) util/web-platform?)]
       (cond
         (instance? ExceptionInfo result)
         nil

+ 1 - 1
src/main/frontend/handler/file_sync.cljs

@@ -101,7 +101,7 @@
   []
   (when-not (state/sub [:file-sync/remote-graphs :loading])
     (go
-      (when-not (or (util/web-platform?) (util/mobile?))
+      (when-not (or util/web-platform? (util/mobile?))
         (state/set-state! [:file-sync/remote-graphs :loading] true)
         (let [graphs-or-exp (<! (<list-graphs))]
           (when-not (instance? ExceptionInfo graphs-or-exp)

+ 1 - 1
src/main/frontend/handler/repo.cljs

@@ -172,7 +172,7 @@
                   repos
                   (concat
                    (state/get-rtc-graphs)
-                   (when-not (or (util/mobile?) (util/web-platform?))
+                   (when-not (or (util/mobile?) util/web-platform?)
                      (state/get-remote-file-graphs))))]
     (state/set-repos! repos')
     repos'))