Просмотр исходного кода

fix(ui): can't close the file sync related modals for the onboarding flow

charlie 1 год назад
Родитель
Сommit
1638d5274d
2 измененных файлов с 11 добавлено и 10 удалено
  1. 5 5
      src/main/frontend/components/file_sync.cljs
  2. 6 5
      src/main/frontend/handler/events.cljs

+ 5 - 5
src/main/frontend/components/file_sync.cljs

@@ -823,21 +823,21 @@
 (defn make-onboarding-panel
   [type]
 
-  (fn [close-fn]
+  (fn [{:keys [close]}]
 
     (case type
       :welcome
-      (onboarding-welcome-logseq-sync close-fn)
+      (onboarding-welcome-logseq-sync close)
 
       :unavailable
-      (onboarding-unavailable-file-sync close-fn)
+      (onboarding-unavailable-file-sync close)
 
       :congrats
-      (onboarding-congrats-successful-sync close-fn)
+      (onboarding-congrats-successful-sync close)
 
       [:p
        [:h1.text-xl.font-bold "Not handled!"]
-       [:a.button {:on-click close-fn} "Got it!"]])))
+       [:a.button {:on-click close} "Got it!"]])))
 
 (defn maybe-onboarding-show
   [type]

+ 6 - 5
src/main/frontend/handler/events.cljs

@@ -752,11 +752,12 @@
 
 (defmethod handle :file-sync/onboarding-tip [[_ type opts]]
   (let [type (keyword type)]
-    (shui/dialog-open!
-      (file-sync/make-onboarding-panel type)
-      (merge {:close-btn?      false
-              :center?         true
-              :close-backdrop? (not= type :welcome)} opts))))
+    (when-not (config/db-based-graph? (state/get-current-repo))
+      (shui/dialog-open!
+        (file-sync/make-onboarding-panel type)
+        (merge {:close-btn? false
+                :center? true
+                :close-backdrop? (not= type :welcome)} opts)))))
 
 (defmethod handle :file-sync/maybe-onboarding-show [[_ type]]
   (file-sync/maybe-onboarding-show type))