mirror of https://github.com/logseq/logseq
enhance(mobile): add a refresh button
parent
ccd5b6e69a
commit
dc9ca3462b
|
@ -11,5 +11,9 @@
|
|||
"splashImmersive": true,
|
||||
"backgroundColor": "#002b36"
|
||||
}
|
||||
},
|
||||
"server": {
|
||||
"url": "http://192.168.0.104:3001",
|
||||
"cleartext": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@ const config: CapacitorConfig = {
|
|||
}
|
||||
// do not commit this into source control
|
||||
// source: https://capacitorjs.com/docs/guides/live-reload
|
||||
//, server: {
|
||||
// url: process.env.LOGSEQ_APP_SERVER_URL,
|
||||
// cleartext: true
|
||||
//}
|
||||
, server: {
|
||||
url: "http://192.168.0.104:3001" //process.env.LOGSEQ_APP_SERVER_URL,
|
||||
cleartext: true
|
||||
}
|
||||
};
|
||||
|
||||
export = config;
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
[reitit.frontend.easy :as rfe]
|
||||
[rum.core :as rum]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.components.widgets :as widgets]))
|
||||
[frontend.components.widgets :as widgets]
|
||||
[frontend.handler.web.nfs :as nfs-handler]))
|
||||
|
||||
(rum/defc home-button []
|
||||
(ui/with-shortcut :go/home "left"
|
||||
|
@ -205,9 +206,24 @@
|
|||
|
||||
(new-block-mode)
|
||||
|
||||
(when refreshing?
|
||||
[:div {:class "animate-spin-reverse"}
|
||||
svg/refresh])
|
||||
(when (mobile-util/is-native-platform?)
|
||||
[:a.text-sm.font-medium.button
|
||||
{:on-click
|
||||
(fn []
|
||||
(state/pub-event!
|
||||
[:modal/show
|
||||
[:div {:style {:max-width 700}}
|
||||
[:p "Refresh detects and processes files modified on your disk and diverged from the actual Logseq page content. Continue?"]
|
||||
(ui/button
|
||||
"Yes"
|
||||
:on-click (fn []
|
||||
(state/close-modal!)
|
||||
(nfs-handler/refresh! (state/get-current-repo) repo/refresh-cb)))]]))}
|
||||
(if refreshing?
|
||||
[:div {:class "animate-spin-reverse"}
|
||||
svg/refresh]
|
||||
[:div.flex.flex-row.text-center.open-button__inner.items-center
|
||||
(ui/icon "refresh" {:style {:fontSize ui/icon-size}})])])
|
||||
|
||||
(repo/sync-status current-repo)
|
||||
|
||||
|
|
Loading…
Reference in New Issue