mirror of https://github.com/logseq/logseq
fix: multiple onboarding issues
parent
ef9075a684
commit
2756f4a8ae
|
@ -157,12 +157,12 @@
|
|||
:text (h/render-html [:section [:h2 "🖼 Home for your whiteboards"]
|
||||
[:p "Whiteboards have their own section in the app where you can see them at a glance, create new ones or delete them easily."]])
|
||||
:attachTo {:element ".nav-header .whiteboard" :on "right"}
|
||||
:beforeShowPromise #(if (state/sub :ui/sidebar-open?)
|
||||
(wait-target state/hide-right-sidebar! 700)
|
||||
(p/resolved true))
|
||||
:beforeShowPromise (fn []
|
||||
(when-not (state/sub :ui/left-sidebar-open?)
|
||||
(state/toggle-left-sidebar!))
|
||||
(wait-target ".nav-header .whiteboard" 500))
|
||||
:canClickTarget true
|
||||
:buttons [{:text "Next" :action (do (router-handler/redirect-to-whiteboard-dashboard!)
|
||||
(.-next jsTour))}]
|
||||
:buttons [{:text "Next" :action (.-next jsTour)}]
|
||||
:popperOptions {:modifiers [{:name "preventOverflow"
|
||||
:options {:padding 20}}
|
||||
{:name "offset"
|
||||
|
@ -172,12 +172,16 @@
|
|||
{:id "whiteboard-new"
|
||||
:text (h/render-html [:section [:h2 "🆕️ Create new whiteboard"]
|
||||
[:p "There is multiple ways of creating a new whiteboard. One of them is always right here in the dashboard."]])
|
||||
:beforeShowPromise #((if-not (state/sub :ui/left-sidebar-open?)
|
||||
(wait-target state/toggle-left-sidebar! 500)
|
||||
(p/resolved true)))
|
||||
:attachTo {:element "#tl-create-whiteboard" :on "bottom"}
|
||||
:beforeShowPromise (fn []
|
||||
(router-handler/redirect-to-whiteboard-dashboard!)
|
||||
(wait-target ".dashboard-create-card" 500))
|
||||
:attachTo {:element ".dashboard-create-card" :on "bottom"}
|
||||
:buttons [{:text "Back" :classes "back" :action (.-back jsTour)}
|
||||
{:text "Finish" :action (.-complete jsTour)}]}])
|
||||
{:text "Finish" :action (.-complete jsTour)}]
|
||||
:popperOptions {:modifiers [{:name "preventOverflow"
|
||||
:options {:padding 20}}
|
||||
{:name "offset"
|
||||
:options {:offset [0, 10]}}]}}])
|
||||
|
||||
(defn start
|
||||
[]
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
[frontend.rum :refer [use-bounding-client-rect use-breakpoint
|
||||
use-click-outside]]
|
||||
[frontend.state :as state]
|
||||
[frontend.storage :as storage]
|
||||
[frontend.ui :as ui]
|
||||
[frontend.util :as util]
|
||||
[promesa.core :as p]
|
||||
|
@ -298,14 +299,14 @@
|
|||
(defn onboarding-show
|
||||
[]
|
||||
(when (and (user-handler/feature-available? :whiteboard)
|
||||
(not (or (state/enable-whiteboards?)
|
||||
(state/sub :whiteboard/onboarding?))))
|
||||
(not (or (state/sub :whiteboard/onboarding?)
|
||||
(state/enable-whiteboards?))))
|
||||
(state/pub-event! [:whiteboard/onboarding])
|
||||
(state/set-state! [:whiteboard/onboarding?] true)))
|
||||
(state/set-state! [:whiteboard/onboarding?] true)
|
||||
(storage/set :whiteboard-onboarding? true)))
|
||||
|
||||
(rum/defc onboarding-welcome
|
||||
[close-fn]
|
||||
(try
|
||||
[:div.cp__whiteboard-welcome
|
||||
[:span.head-bg
|
||||
|
||||
|
@ -321,11 +322,7 @@
|
|||
(ui/button (t :on-boarding/welcome-whiteboard-modal-start)
|
||||
:on-click (fn []
|
||||
(config-handler/set-config! :feature/enable-whiteboards? true)
|
||||
(do (quick-tour/ready
|
||||
(quick-tour/ready
|
||||
(fn []
|
||||
(quick-tour/start-whiteboard)
|
||||
(state/set-state! :whiteboard/onboarding? true)
|
||||
(close-fn)))
|
||||
(throw (js/Error. nil)))))]]
|
||||
(catch :default e
|
||||
(js/console.warn "[Whiteboard onboarding SKIP] " (name type) e))))
|
||||
(close-fn)))))]])
|
||||
|
|
|
@ -275,7 +275,7 @@
|
|||
:graph/importing-state {}
|
||||
|
||||
:whiteboard/onboarding-whiteboard? (or (storage/get :ls-onboarding-whiteboard?) false)
|
||||
:whiteboard/onboarding? (or (storage/get :whiteboard/onboarding?) false)})))
|
||||
:whiteboard/onboarding? (or (storage/get :whiteboard-onboarding?) false)})))
|
||||
|
||||
;; Block ast state
|
||||
;; ===============
|
||||
|
|
Loading…
Reference in New Issue