fix(sync): revert sync immediately

This commit is contained in:
Tienson Qin
2020-10-31 08:17:55 +08:00
parent 735e9ba70c
commit 2112e72c39
3 changed files with 17 additions and 18 deletions

View File

@@ -511,7 +511,8 @@
:else
(move-block-in-different-repos target-block-repo to-block-repo target-block to-block top-block bottom-block nested? top? target-child? direction target-content target-file original-top-block-start-pos block-changes))
(when (state/git-auto-push?)
(doseq [repo (->> #{target-block-repo to-block-repo}
(remove nil?))]
(repo-handler/push repo nil)))))))
;; (when (state/git-auto-push?)
;; (doseq [repo (->> #{target-block-repo to-block-repo}
;; (remove nil?))]
;; (repo-handler/push repo nil)))
))))

View File

@@ -545,8 +545,9 @@
(when (or (seq retract-refs) pre-block?)
(ui-handler/re-render-root!))
(when (state/git-auto-push?)
(repo-handler/push repo nil)))
;; (when (state/git-auto-push?)
;; (repo-handler/push repo nil))
)
:else
nil))))))

View File

@@ -318,16 +318,14 @@
(db/cloned? repo-url)
token)
(let [status (db/get-key-value repo-url :git/status)]
(when (and
(not= status :pulling)
(or
force-pull?
(and
;; (not= status :push-failed)
(not= status :pushing)
(empty? (state/get-changed-files repo-url))
(not (state/get-edit-input-id))
(not (state/in-draw-mode?)))))
(when (or
force-pull?
(and
;; (not= status :push-failed)
(not= status :pushing)
(empty? (state/get-changed-files repo-url))
(not (state/get-edit-input-id))
(not (state/in-draw-mode?))))
(git-handler/set-git-status! repo-url :pulling)
(let [latest-commit (db/get-key-value repo-url :git/latest-commit)]
(->
@@ -405,8 +403,7 @@
(let [status (db/get-key-value repo-url :git/status)]
(when (and
(db/cloned? repo-url)
(not (state/get-edit-input-id))
(not= status :pushing))
(not (state/get-edit-input-id)))
(-> (p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir (state/get-current-repo)))]
(when (or
;; FIXME: