This commit is contained in:
Tienson Qin
2020-07-09 18:27:43 +08:00
parent 2deb0c3140
commit f76597ab7b
4 changed files with 19 additions and 15 deletions

View File

@@ -89,13 +89,9 @@
latest-journals (db/get-latest-journals (state/get-current-repo) journals-length)
preferred-format (state/sub [:me :preferred_format])
logged? (:name me)
token (state/sub :encrypt/token)
db-restoring? (state/sub :db/restoring?)]
token (state/sub :encrypt/token)]
[:div.max-w-7xl.mx-auto
(cond
db-restoring?
(widgets/loading "Loading")
(and (not logged?) (seq latest-journals))
(journal/journals latest-journals)
@@ -160,7 +156,8 @@
theme (state/sub :ui/theme)
white? (= "white" (state/sub :ui/theme))
global-graph-pages? (= :graph (get-in route-match [:data :name]))
logged? (:name me)]
logged? (:name me)
db-restoring? (state/sub :db/restoring?)]
[:div {:class (if white? "white-theme" "dark-theme")
:on-click (fn []
(handler/unhighlight-heading!))}
@@ -294,9 +291,18 @@
{:position "relative"
:max-width 700
:margin-bottom 200})}
(if global-graph-pages?
(cond
db-restoring?
[:div.mt-20
[:div.ls-center
(widgets/loading "Loading")]]
global-graph-pages?
main-content
[:div.m-6 main-content])]]]
:else
[:div.m-6
main-content])]]]
(right-sidebar/sidebar)]
[:a.opacity-70.hover:opacity-100.absolute.hidden.md:block
{:title "Logseq"

View File

@@ -30,8 +30,6 @@
state)}
[opts]
(let [loading? (rum/react *loading?)]
(if loading?
(widgets/loading "Loading")
(when @graph-component
(@graph-component
opts)))))
(when @graph-component
(@graph-component
opts))))

View File

@@ -53,7 +53,7 @@
(let [loading? (rum/react *loading?)]
[:div.reveal {:style {:height 400}}
(when loading?
(widgets/loading "Loading"))
[:div.ls-center (widgets/loading "")])
[:div.slides
(for [[idx sections] (medley/indexed sections)]
(if (> (count sections) 1) ; nested

View File

@@ -1340,10 +1340,10 @@
[{:url config/local-repo}])]
(when me (set-state-kv! :me me))
(state/set-db-restoring! true)
(render)
(-> (p/all (db/restore! (assoc me :repos repos) db-listen-to-tx! restore-config!))
(p/then
(fn []
(render)
(if (and (not logged?)
(not (seq (db/get-files config/local-repo))))
(setup-local-repo-if-not-exists!)