diff --git a/src/main/frontend/components/settings.cljs b/src/main/frontend/components/settings.cljs index 430bd97a83..090345c551 100644 --- a/src/main/frontend/components/settings.cljs +++ b/src/main/frontend/components/settings.cljs @@ -82,23 +82,23 @@ (util/stop e))} svg/external-link " release channel"]])])])) -(rum/defc delete-account-confirm - [close-fn] - [:div - (ui/admonition - :important - [:p.text-gray-700 (t :user/delete-account-notice)]) - [:div.mt-5.sm:mt-4.sm:flex.sm:flex-row-reverse - [:span.flex.w-full.rounded-md.sm:ml-3.sm:w-auto - [:button.inline-flex.justify-center.w-full.rounded-md.border.border-transparent.px-4.py-2.bg-indigo-600.text-base.leading-6.font-medium.text-white.shadow-sm.hover:bg-indigo-500.focus:outline-none.focus:border-indigo-700.focus:shadow-outline-indigo.transition.ease-in-out.duration-150.sm:text-sm.sm:leading-5 - {:type "button" - :on-click user-handler/deprecated-delete-account!} - (t :user/delete-account)]] - [:span.mt-3.flex.w-full.rounded-md.sm:mt-0.sm:w-auto - [:button.inline-flex.justify-center.w-full.rounded-md.border.border-gray-300.px-4.py-2.bg-white.text-base.leading-6.font-medium.text-gray-700.shadow-sm.hover:text-gray-500.focus:outline-none.focus:border-blue-300.focus:shadow-outline-blue.transition.ease-in-out.duration-150.sm:text-sm.sm:leading-5 - {:type "button" - :on-click close-fn} - "Cancel"]]]]) +;; (rum/defc delete-account-confirm +;; [close-fn] +;; [:div +;; (ui/admonition +;; :important +;; [:p.text-gray-700 (t :user/delete-account-notice)]) +;; [:div.mt-5.sm:mt-4.sm:flex.sm:flex-row-reverse +;; [:span.flex.w-full.rounded-md.sm:ml-3.sm:w-auto +;; [:button.inline-flex.justify-center.w-full.rounded-md.border.border-transparent.px-4.py-2.bg-indigo-600.text-base.leading-6.font-medium.text-white.shadow-sm.hover:bg-indigo-500.focus:outline-none.focus:border-indigo-700.focus:shadow-outline-indigo.transition.ease-in-out.duration-150.sm:text-sm.sm:leading-5 +;; {:type "button" +;; :on-click user-handler/deprecated-delete-account!} +;; (t :user/delete-account)]] +;; [:span.mt-3.flex.w-full.rounded-md.sm:mt-0.sm:w-auto +;; [:button.inline-flex.justify-center.w-full.rounded-md.border.border-gray-300.px-4.py-2.bg-white.text-base.leading-6.font-medium.text-gray-700.shadow-sm.hover:text-gray-500.focus:outline-none.focus:border-blue-300.focus:shadow-outline-blue.transition.ease-in-out.duration-150.sm:text-sm.sm:leading-5 +;; {:type "button" +;; :on-click close-fn} +;; "Cancel"]]]]) (rum/defc outdenting-hint [] diff --git a/src/main/frontend/components/sidebar.cljs b/src/main/frontend/components/sidebar.cljs index fb5282424f..d9e679796f 100644 --- a/src/main/frontend/components/sidebar.cljs +++ b/src/main/frontend/components/sidebar.cljs @@ -9,6 +9,7 @@ [frontend.components.theme :as theme] [frontend.components.widgets :as widgets] [frontend.components.plugins :as plugins] + [frontend.components.select :as select] [frontend.config :as config] [frontend.context.i18n :refer [t]] [frontend.db :as db] @@ -348,7 +349,7 @@ loading-files? (when current-repo (state/sub [:repo/loading-files? current-repo])) journals-length (state/sub :journals-length) latest-journals (db/get-latest-journals (state/get-current-repo) journals-length) - ;; preferred-format (state/sub [:me :preferred_format]) + preferred-format (state/sub [:me :preferred_format]) logged? (user-handler/logged?)] [:div (cond diff --git a/src/main/frontend/components/svg.cljs b/src/main/frontend/components/svg.cljs index bc05442339..ee5b15756e 100644 --- a/src/main/frontend/components/svg.cljs +++ b/src/main/frontend/components/svg.cljs @@ -82,8 +82,8 @@ (def folder (hero-icon "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z")) (def settings-sm [:svg {:viewBox "0 0 20 20", :fill "currentColor", :height "20", :width "20"} [:path {:fill-rule "evenodd", :d "M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z", :clip-rule "evenodd"}]]) -(def logout-sm [:svg {:viewBox "0 0 20 20", :fill "currentColor", :height "18", :width "18"} - [:path {:fill-rule "evenodd", :d "M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z", :clip-rule "evenodd"}]]) +;; (def logout-sm [:svg {:viewBox "0 0 20 20", :fill "currentColor", :height "18", :width "18"} +;; [:path {:fill-rule "evenodd", :d "M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z", :clip-rule "evenodd"}]]) (def trash-sm [:svg {:viewBox "0 0 20 20", :fill "currentColor", :height "16", :width "16"} [:path {:fill-rule "evenodd", :d "M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z", :clip-rule "evenodd"}]]) (def external-link diff --git a/src/main/frontend/handler/user.cljs b/src/main/frontend/handler/user.cljs index 708acd7848..7a5e8247b1 100644 --- a/src/main/frontend/handler/user.cljs +++ b/src/main/frontend/handler/user.cljs @@ -3,34 +3,30 @@ [frontend.db :as db] [frontend.handler.config :as config-handler] [frontend.handler.notification :as notification] - [frontend.idb :as idb] [frontend.state :as state] [frontend.util :as util] [frontend.debug :as debug] - [lambdaisland.glogi :as log] - [promesa.core :as p] [clojure.string :as string] [cljs-time.core :as t] [cljs-time.coerce :as tc] [cljs-http.client :as http] - [cljs.core.async :as async :refer [go go-loop - (idb/clear-local-storage-and-idb!) - (p/catch (fn [e] - (println "sign out error: ") - (js/console.dir e))) - (p/finally (fn [] - (set! (.-href js/window.location) "/logout"))))))) +;; (defn deprecated-sign-out! +;; ([] +;; (deprecated-sign-out! true)) +;; ([confirm?] +;; (when (or (not confirm?) +;; (js/confirm "Your local notes will be completely removed after signing out. Continue?")) +;; (-> +;; (idb/clear-local-storage-and-idb!) +;; (p/catch (fn [e] +;; (println "sign out error: ") +;; (js/console.dir e))) +;; (p/finally (fn [] +;; (set! (.-href js/window.location) "/logout"))))))) -(defn deprecated-delete-account! - [] - (p/let [_ (idb/clear-local-storage-and-idb!)] - (util/delete (str config/api "account") - (fn [] - (deprecated-sign-out! false)) - (fn [error] - (log/error :user/delete-account-failed error))))) +;; (defn deprecated-delete-account! +;; [] +;; (p/let [_ (idb/clear-local-storage-and-idb!)] +;; (util/delete (str config/api "account") +;; (fn [] +;; (deprecated-sign-out! false)) +;; (fn [error] +;; (log/error :user/delete-account-failed error))))) diff --git a/src/main/frontend/mobile/util.cljs b/src/main/frontend/mobile/util.cljs index d63e9e5eb9..f3f4808c35 100644 --- a/src/main/frontend/mobile/util.cljs +++ b/src/main/frontend/mobile/util.cljs @@ -21,8 +21,6 @@ (.convertFileSrc Capacitor path-str)) (defonce folder-picker (registerPlugin "FolderPicker")) -(when (native-android?) - (defonce file-sync (registerPlugin "GraphFileSync"))) (when (native-ios?) (defonce download-icloud-files (registerPlugin "DownloadiCloudFiles")) (defonce ios-file-container (registerPlugin "FileContainer"))) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 438bc8bb50..0d44e7b3d0 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -1533,9 +1533,6 @@ (set-selection-blocks! blocks direction) (util/select-highlight! blocks))) -(defn add-watch-state [key f] - (add-watch state key f)) - (defn remove-watch-state [key] (remove-watch state key)) @@ -1671,30 +1668,15 @@ (defn get-auth-id-token [] (:auth/id-token @state)) -(defn get-auth-access-token [] - (:auth/access-token @state)) - (defn get-auth-refresh-token [] (:auth/refresh-token @state)) (defn set-file-sync-manager [v] (set-state! :file-sync/sync-manager v)) -(defn set-file-sync-state-manager [v] - (set-state! :file-sync/sync-state-manager v)) (defn set-file-sync-state [v] (set-state! :file-sync/sync-state v)) -(defn set-file-sync-uploading-files [v] - (set-state! :file-sync/sync-uploading-files v)) -(defn set-file-sync-downloading-files [v] - (set-state! :file-sync/sync-downloading-files v)) (defn get-file-sync-manager [] (:file-sync/sync-manager @state)) -(defn get-file-sync-state-manager [] - (:file-sync/sync-state-manager @state)) (defn get-file-sync-state [] (:file-sync/sync-state @state)) -(defn get-file-sync-uploading-files [] - (:file-sync/sync-uploading-files @state)) -(defn get-file-sync-downloading-files [] - (:file-sync/sync-downloading-files @state))