enhance(capacitor): improve classic block editor

This commit is contained in:
charlie
2025-05-23 18:50:20 +08:00
parent 0c8e66bda7
commit 2608badecc
4 changed files with 13 additions and 2 deletions

View File

@@ -216,8 +216,15 @@
(not (nil? (state/get-editing-block)))
(state/exit-editing!)
(seq (ui/get-modal))
nil
:else
(cc-utils/nav-pop!)))
(-> (cc-utils/nav-length?)
(p/then (fn [len]
(if (= len 1)
(.exitApp App)
(cc-utils/nav-pop!)))))))
^js back-listener (.addListener App "backButton" handle-back!)]
#(.remove back-listener)))
[])

View File

@@ -1,5 +1,5 @@
html, body {
@apply text-[18px] leading-6;
@apply text-[18px] leading-6 min-h-[unset];
}
#root {
@apply p-4;

View File

@@ -12,6 +12,9 @@
(defn nav-pop! []
(some-> @state/*nav-root (.pop)))
(defn nav-length? []
(some-> ^js @state/*nav-root (.getLength)))
(defn nav-to-block!
[page-or-block opts]
(nav-push! #(cc-blocks/page page-or-block opts)))