refactor(git): remove our own changed-files cache

This commit is contained in:
Tienson Qin
2020-11-01 00:21:04 +08:00
parent 7824973abc
commit 7a5324a08e
12 changed files with 239 additions and 239 deletions

View File

@@ -0,0 +1,19 @@
(ns frontend.handler.common
(:require [goog.object :as gobj]
[frontend.state :as state]
[cljs-bean.core :as bean]
[promesa.core :as p]
[frontend.util :as util]))
(defn check-changed-files-status
[]
(when-let [repo (state/get-current-repo)]
(when (and
(gobj/get js/window "workerThread")
(gobj/get js/window.workerThread "getChangedFiles"))
(->
(p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir repo))]
(let [files (bean/->clj files)]
(state/set-changed-files! repo files)))
(p/catch (fn [error]
(js/console.dir error)))))))