Replace logo.png with svg

pull/645/head
Tienson Qin 2020-05-09 20:28:57 +08:00
parent c795ee408d
commit 9cafb596c9
3 changed files with 17 additions and 25 deletions

View File

@ -69,7 +69,6 @@
;; repo
:repo/url {:db/unique :db.unique/identity}
:repo/cloned? {}
:git/latest-commit {}
:git/status {}
;; last error, better we should record all the errors
@ -381,23 +380,6 @@
react
sort-by-pos)))
(defn mark-repo-as-cloned
[repo-url]
(transact!
[{:repo/url repo-url
:repo/cloned? true}]))
(defn cloned?
[repo-url]
(->
(d/q '[:find ?cloned
:in $ ?repo-url
:where
[?repo :repo/url ?repo-url]
[?repo :repo/cloned? ?cloned]]
(get-conn repo-url) repo-url)
ffirst))
(defn get-page-name
[file ast]
(when-let [heading (first (filter block/heading-block? ast))]

View File

@ -43,6 +43,13 @@
(write-file dir path initial-content)
false))))
(defn file-exists?
[dir path]
(util/p-handle
(stat dir path)
(fn [_stat] true)
(fn [_e] false)))
(comment
(def dir "/notes")
)

View File

@ -49,7 +49,8 @@
content)
(p/catch
(fn [e]
(prn "load file failed, " e)))))
;; (prn "load file failed, " e)
))))
(defn redirect!
"If `push` is truthy, previous page will be left in history."
@ -381,7 +382,6 @@
(db/start-db-conn! (:me @state/state)
repo-url
db-listen-to-tx!)
(db/mark-repo-as-cloned repo-url)
(set-latest-commit-if-exists! repo-url)
(util/post (str config/api "repos")
{:url repo-url}
@ -868,11 +868,14 @@
(db/restore! me db-listen-to-tx!)
(doseq [{:keys [id url]} repos]
(let [repo url]
(if (db/cloned? repo)
(do
(git-set-username-email! repo me)
(periodically-pull-and-push repo {:pull-now? true}))
(clone-and-pull repo))))
(p/let [config-exists? (fs/file-exists?
(git/get-repo-dir url)
".git/config")]
(if config-exists?
(do
(git-set-username-email! repo me)
(periodically-pull-and-push repo {:pull-now? true}))
(clone-and-pull repo)))))
(watch-config!)))
(defn upload-image