diff --git a/src/main/frontend/mobile/footer.cljs b/src/main/frontend/mobile/footer.cljs index 2ace77c285..5d953fc5cc 100644 --- a/src/main/frontend/mobile/footer.cljs +++ b/src/main/frontend/mobile/footer.cljs @@ -50,7 +50,8 @@ (rum/defc footer < rum/reactive [] - (when (and (state/sub :mobile/show-tabbar?) + (when (and (not (state/sub :editor/editing?)) + (state/sub :mobile/show-tabbar?) (state/get-current-repo)) [:div.cp__footer.w-full.bottom-0.justify-between (audio-record-cp) diff --git a/src/main/frontend/mobile/mobile_bar.cljs b/src/main/frontend/mobile/mobile_bar.cljs index 55af9e855b..990b43161b 100644 --- a/src/main/frontend/mobile/mobile_bar.cljs +++ b/src/main/frontend/mobile/mobile_bar.cljs @@ -7,6 +7,7 @@ [frontend.handler.history :as history] [frontend.handler.page :as page-handler] [frontend.mobile.camera :as mobile-camera] + [frontend.mobile.util :as mobile-util] [frontend.state :as state] [frontend.ui :as ui] [frontend.util :as util] @@ -115,27 +116,26 @@ (rum/defc mobile-bar < rum/reactive [] - (when (and (state/sub :mobile/toolbar-update-observer) - (state/sub :mobile/show-toolbar?)) + (when (and (state/sub :editor/editing?) + (or (state/sub :mobile/show-toolbar?) + (mobile-util/native-ipad?)) + (state/sub :mobile/toolbar-update-observer)) (when-let [config-toolbar-stats (:mobile/toolbar-stats (state/get-config))] - (prn :config-toolbar-stats config-toolbar-stats) (reset! commands-stats config-toolbar-stats)) (let [parent-id (state/get-edit-input-id) commands (commands parent-id) sorted-commands (sort-by (comp :counts second) > @commands-stats)] - (when (and (state/sub :mobile/show-toolbar?) - (state/sub :editor/editing?)) - [:div#mobile-editor-toolbar.bg-base-2 - [:div.toolbar-commands - (indent-outdent false "indent-decrease") - (indent-outdent true "indent-increase") - (command (editor-handler/move-up-down true) "arrow-bar-to-up") - (command (editor-handler/move-up-down false) "arrow-bar-to-down") - (command #(if (state/sub :document/mode?) - (editor-handler/insert-new-block! nil) - (commands/simple-insert! parent-id "\n" {})) "arrow-back") - (for [command sorted-commands] - ((first command) commands))] - [:div.toolbar-hide-keyboard - (command #(state/clear-edit!) "keyboard-show")]])))) + [:div#mobile-editor-toolbar.bg-base-2 + [:div.toolbar-commands + (indent-outdent false "indent-decrease") + (indent-outdent true "indent-increase") + (command (editor-handler/move-up-down true) "arrow-bar-to-up") + (command (editor-handler/move-up-down false) "arrow-bar-to-down") + (command #(if (state/sub :document/mode?) + (editor-handler/insert-new-block! nil) + (commands/simple-insert! parent-id "\n" {})) "arrow-back") + (for [command sorted-commands] + ((first command) commands))] + [:div.toolbar-hide-keyboard + (command #(state/clear-edit!) "keyboard-show")]])))