Forráskód Böngészése

fix: preview card

close #4542
Tienson Qin 3 éve
szülő
commit
8cb6d26465
2 módosított fájl, 5 hozzáadás és 1 törlés
  1. 1 1
      src/main/frontend/extensions/srs.cljs
  2. 4 0
      src/main/frontend/util.cljc

+ 1 - 1
src/main/frontend/extensions/srs.cljs

@@ -498,7 +498,7 @@
   rum/reactive
   db-mixins/query
   [blocks option card-index]
-  (let [option (update option :random-mode? (fn [v] (if (boolean? v) v @v)))
+  (let [option (update option :random-mode? (fn [v] (if (util/atom? v) @v v)))
         blocks (if (fn? blocks) (blocks) blocks)
         blocks (if (:random-mode? option)
                  (shuffle blocks)

+ 4 - 0
src/main/frontend/util.cljc

@@ -1456,3 +1456,7 @@
 (defn collapsed?
   [block]
   (:block/collapsed? block))
+
+#?(:cljs
+   (defn atom? [v]
+     (instance? Atom v)))