From 666981ef0bd940b9f5d5043c925e73244d1d8bec Mon Sep 17 00:00:00 2001 From: Emin Devrim Fidan Date: Fri, 2 Sep 2022 23:06:26 +0300 Subject: [PATCH 1/6] "Themes" translation corrected --- src/main/frontend/dicts.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/frontend/dicts.cljc b/src/main/frontend/dicts.cljc index bf4bf0216e..62d119577a 100644 --- a/src/main/frontend/dicts.cljc +++ b/src/main/frontend/dicts.cljc @@ -4237,7 +4237,7 @@ :settings "Ayarlar" :settings-of-plugins "Eklenti ayarları" :plugins "Eklentiler" - :themes "Temelar" + :themes "Temalar" :developer-mode-alert "Eklenti sistemini etkinleştirmek için uygulamayı yeniden başlatmanız gerekir. Şimdi yeniden başlatmak istiyor musunuz?" :relaunch-confirm-to-work "Çalışması için uygulama yeniden başlatılmalı. Şimdi yeniden başlatmak istiyor musunuz?" :import "İçeri aktar" From e9ee940873ef5967a18e0bd4aa37611b76aa86ef Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 3 Sep 2022 20:49:11 +0800 Subject: [PATCH 2/6] fix: don't start sync if not logged in or it's not a remote graph --- src/main/frontend/commands.cljs | 3 +-- src/main/frontend/fs/sync.cljs | 11 +++++++---- src/main/frontend/state.cljs | 5 ----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/frontend/commands.cljs b/src/main/frontend/commands.cljs index f1c70e2329..be516ee008 100644 --- a/src/main/frontend/commands.cljs +++ b/src/main/frontend/commands.cljs @@ -237,8 +237,7 @@ ["Upload an asset" [[:editor/click-hidden-file-input :id]] "Upload file types like image, pdf, docx, etc.)"] - (state/deprecated-logged?) - ["Upload an image" [[:editor/click-hidden-file-input :id]]] + ;; ["Upload an image" [[:editor/click-hidden-file-input :id]]] )] (markdown-headings) diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 21b51b4ee1..04330516df 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -2712,10 +2712,13 @@ (go ;; stop previous sync ( Date: Sat, 3 Sep 2022 22:21:37 +0800 Subject: [PATCH 3/6] fix(sync): wrong stop-sync condition check --- src/main/frontend/fs/sync.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 04330516df..1511d4ae7a 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -1544,8 +1544,7 @@ [type {:keys [dir path _content stat] :as _payload}] (when-let [current-graph (state/get-current-repo)] (when (string/ends-with? current-graph dir) - (when-not (some-> (state/get-file-sync-state current-graph) - sync-state--stopped?) + (when-not (sync-state--stopped? (state/get-file-sync-state current-graph)) (when (or (:mtime stat) (= type "unlink")) (go (let [path (remove-dir-prefix dir path) @@ -1976,8 +1975,9 @@ add-history? (update :history add-history-items paths now)))) (defn sync-state--stopped? + "Graph syncing is stopped or not enabled" [sync-state] - (= ::stop (:state sync-state))) + (or (nil? sync-state) (= ::stop (:state sync-state)))) ;;; ### remote->local syncer & local->remote syncer From 1f7269182b7642858a6c15ea14c0f6435b26c065 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 5 Sep 2022 10:33:37 +0800 Subject: [PATCH 4/6] fix: remove tricky check --- src/main/frontend/fs/sync.cljs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 1511d4ae7a..4419c52035 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -1544,14 +1544,15 @@ [type {:keys [dir path _content stat] :as _payload}] (when-let [current-graph (state/get-current-repo)] (when (string/ends-with? current-graph dir) - (when-not (sync-state--stopped? (state/get-file-sync-state current-graph)) - (when (or (:mtime stat) (= type "unlink")) - (go - (let [path (remove-dir-prefix dir path) - files-meta (and (not= "unlink" type) - ( files-meta first :etag))] - (>! local-changes-chan (->FileChangeEvent type dir path stat checksum))))))))) + (let [sync-state (state/get-file-sync-state current-graph)] + (when (and sync-state (not (sync-state--stopped? sync-state))) + (when (or (:mtime stat) (= type "unlink")) + (go + (let [path (remove-dir-prefix dir path) + files-meta (and (not= "unlink" type) + ( files-meta first :etag))] + (>! local-changes-chan (->FileChangeEvent type dir path stat checksum)))))))))) (defn local-changes-revised-chan-builder "return chan" @@ -1975,9 +1976,9 @@ add-history? (update :history add-history-items paths now)))) (defn sync-state--stopped? - "Graph syncing is stopped or not enabled" + "Graph syncing is stopped" [sync-state] - (or (nil? sync-state) (= ::stop (:state sync-state)))) + (= ::stop (:state sync-state))) ;;; ### remote->local syncer & local->remote syncer From 86c18bd70689adec79f876c273e4908b8421589b Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 5 Sep 2022 11:09:33 +0800 Subject: [PATCH 5/6] fix: add pre condition for sync-state --- src/main/frontend/fs/sync.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 4419c52035..25e5baf999 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -1978,6 +1978,7 @@ (defn sync-state--stopped? "Graph syncing is stopped" [sync-state] + {:pre [(s/valid? ::sync-state sync-state)]} (= ::stop (:state sync-state))) ;;; ### remote->local syncer & local->remote syncer From 007d7dc4c67d022ab859da8a8ea68353c492202b Mon Sep 17 00:00:00 2001 From: rcmerci Date: Mon, 5 Sep 2022 11:15:40 +0800 Subject: [PATCH 6/6] fix: get graph-uuid from graphs-txid.edn --- src/main/frontend/handler/file_sync.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/handler/file_sync.cljs b/src/main/frontend/handler/file_sync.cljs index bf5da57707..28cacbea2e 100644 --- a/src/main/frontend/handler/file_sync.cljs +++ b/src/main/frontend/handler/file_sync.cljs @@ -16,6 +16,9 @@ (def refresh-file-sync-component (atom false)) + +(defn get-current-graph-uuid [] (second @sync/graphs-txid)) + (defn enable-sync? [] (or (state/enable-sync?) @@ -58,7 +61,7 @@ (defn ))] all-version-list)))))) -(defn get-current-graph-uuid [] (second @sync/graphs-txid)) (def *wait-syncing-graph (atom nil))