ソースを参照

fix(sync): lint

rcmerci 3 年 前
コミット
d4e8f3135e

+ 17 - 17
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
   []

+ 2 - 1
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

+ 2 - 2
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

+ 39 - 43
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 <! timeout]])
-  (:import [goog.format EmailAddress]))
-
-(defn- email? [v]
-  (and v
-       (.isValid (EmailAddress. v))))
-
-(defn deprecated-set-email!
-  [email]
-  (when (email? email)
-    (util/post (str config/api "email")
-               {:email email}
-               (fn [_result]
-                 (db/transact! [{:me/email email}])
-                 (swap! state/state assoc-in [:me :email] email))
-               (fn [_error]
-                 (notification/show! "Email already exists!"
-                                     :error)))))
+            [cljs.core.async :as async :refer [go go-loop <! timeout]]))
+
+;; (defn- email? [v]
+;;   (and v
+;;        (.isValid (EmailAddress. v))))
+
+;; (defn deprecated-set-email!
+;;   [email]
+;;   (when (email? email)
+;;     (util/post (str config/api "email")
+;;                {:email email}
+;;                (fn [_result]
+;;                  (db/transact! [{:me/email email}])
+;;                  (swap! state/state assoc-in [:me :email] email))
+;;                (fn [_error]
+;;                  (notification/show! "Email already exists!"
+;;                                      :error)))))
 
 (defn set-cors!
   [cors-proxy]
@@ -70,28 +66,28 @@
     ;;              (fn [_e])))
     ))
 
-(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-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)))))
 
 
 

+ 0 - 2
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")))

+ 0 - 18
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))