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

feat: disable export feature on web (now it's electron only)

Junyu Zhan 4 лет назад
Родитель
Сommit
d626be98bf
2 измененных файлов с 10 добавлено и 9 удалено
  1. 2 2
      src/main/frontend/components/header.cljs
  2. 8 7
      src/main/frontend/components/page.cljs

+ 2 - 2
src/main/frontend/components/header.cljs

@@ -126,7 +126,7 @@
           :options {:on-click #(ui-handler/toggle-settings-modal!)}
           :options {:on-click #(ui-handler/toggle-settings-modal!)}
           :icon svg/settings-sm})
           :icon svg/settings-sm})
 
 
-       (when current-repo
+       (when (and (util/electron?) current-repo)
          {:title (t :export)
          {:title (t :export)
           :options {:on-click (fn []
           :options {:on-click (fn []
                                 (export/export-repo-as-html! current-repo))}
                                 (export/export-repo-as-html! current-repo))}
@@ -148,7 +148,7 @@
       (remove nil?))
       (remove nil?))
      ;; {:links-footer (when (and (util/electron?) (not logged?))
      ;; {:links-footer (when (and (util/electron?) (not logged?))
      ;;                  [:div.px-2.py-2 (login logged?)])}
      ;;                  [:div.px-2.py-2 (login logged?)])}
-)))
+     )))
 
 
 (rum/defc header
 (rum/defc header
   < rum/reactive
   < rum/reactive

+ 8 - 7
src/main/frontend/components/page.cljs

@@ -313,13 +313,14 @@
                               {:title (t :page/delete)
                               {:title (t :page/delete)
                                :options {:on-click #(state/set-modal! (delete-page-dialog page-name))}})
                                :options {:on-click #(state/set-modal! (delete-page-dialog page-name))}})
 
 
-                            {:title  (t (if public? :page/make-private :page/make-public))
-                             :options {:on-click
-                                       (fn []
-                                         (page-handler/update-public-attribute!
-                                          page-name
-                                          (if public? false true))
-                                         (state/close-modal!))}}
+                            (when (util/electron?)
+                              {:title  (t (if public? :page/make-private :page/make-public))
+                               :options {:on-click
+                                         (fn []
+                                           (page-handler/update-public-attribute!
+                                            page-name
+                                            (if public? false true))
+                                           (state/close-modal!))}})
 
 
                             (when file
                             (when file
                               {:title (t :page/re-index)
                               {:title (t :page/re-index)