Selaa lähdekoodia

fix: onboarding condition

Peng Xiao 3 vuotta sitten
vanhempi
sitoutus
fbbcb1f862
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      src/main/frontend/handler/whiteboard.cljs

+ 5 - 1
src/main/frontend/handler/whiteboard.cljs

@@ -244,9 +244,13 @@
                                                     :assets assets
                                                     :bindings bindings})))))
 (defn should-populate-onboarding-whiteboard?
+  "When there is not whiteboard, or there is only whiteboard that is the given page name, we should populate the onboarding whiteboard"
   [page-name]
   (let [whiteboards (model/get-all-whiteboards (state/get-current-repo))]
-    (and (or (empty? whiteboards) (some #(= page-name (:block/name %)) whiteboards))
+    (and (or (empty? whiteboards)
+             (and 
+              (= 1 (count whiteboards))
+              (= page-name (:block/name (first whiteboards)))))
          (not (state/get-onboarding-whiteboard?)))))
 
 (defn populate-onboarding-whiteboard