diff --git a/src/main/frontend/components/repo.cljs b/src/main/frontend/components/repo.cljs index dbcafad324..17a1d1882b 100644 --- a/src/main/frontend/components/repo.cljs +++ b/src/main/frontend/components/repo.cljs @@ -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?) diff --git a/src/main/frontend/handler/repo.cljs b/src/main/frontend/handler/repo.cljs index 1c6591fc4b..f09575ad4d 100644 --- a/src/main/frontend/handler/repo.cljs +++ b/src/main/frontend/handler/repo.cljs @@ -407,7 +407,8 @@ (pull repo-url new-opts)) (let [error-msg (util/format "Failed to fetch %s. It may be caused by token expiration or missing." repo-url)] - (log/error :git/pull-error error) + (git-handler/set-git-status! repo-url :fetch-failed) + (log/error :repo/pull-error error) (notification/show! error-msg :error false)))) :else @@ -454,7 +455,7 @@ (pull repo-url {:force-pull? true :show-diff? true})))))))))) (p/catch (fn [error] - (log/error :git/get-changed-files-error error) + (log/error :repo/push-error error) (git-handler/set-git-status! repo-url :push-failed) (git-handler/set-git-error! repo-url error) (js/console.dir error)))))))