fix: show red dot when git clone/checkout/fetch/merge failed

This commit is contained in:
Yukun Guo
2020-12-29 16:31:18 +08:00
committed by Tienson Qin
parent 9c0dabb3de
commit 4fdf595f8f
2 changed files with 11 additions and 3 deletions

View File

@@ -105,6 +105,13 @@
git-status (state/sub [:git/status repo])
pushing? (= :pushing git-status)
pulling? (= :pulling git-status)
git-failed? (contains?
#{:push-failed
:clone-failed
:checkout-failed
:fetch-failed
:merge-failed}
git-status)
push-failed? (= :push-failed git-status)
last-pulled-at (db/sub-key-value repo :git/last-pulled-at)
;; db-persisted? (state/sub [:db/persisted? repo])
@@ -115,7 +122,7 @@
(fn [{:keys [toggle-fn]}]
[:div.cursor.w-2.h-2.sync-status.mr-2
{:class (cond
push-failed?
git-failed?
"bg-red-500"
(or
;; (not db-persisted?)