From 276bfc7aaed1e1966acecd8467c1ea4c9515b019 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 23 May 2022 22:08:48 +0800 Subject: [PATCH] fix: don't show mobile toobar on PC --- src/main/frontend/mobile/footer.cljs | 3 ++- src/main/frontend/state.cljs | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/mobile/footer.cljs b/src/main/frontend/mobile/footer.cljs index 01bff9c7d..932095bde 100644 --- a/src/main/frontend/mobile/footer.cljs +++ b/src/main/frontend/mobile/footer.cljs @@ -46,7 +46,8 @@ (rum/defc footer < rum/reactive [] - (when (and (state/sub :mobile/show-tabbar?) + (when (and (state/mobile?) + (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/state.cljs b/src/main/frontend/state.cljs index 497716ff0..612f22c00 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -58,7 +58,7 @@ :modal/close-btn? nil :modal/subsets [] - + ;; right sidebar :ui/fullscreen? false :ui/settings-open? false @@ -147,7 +147,7 @@ :mobile/show-toolbar? false ;;; toolbar icon doesn't update correctly when clicking after separate it from box, ;;; add a random in (<= 1000000) to observer its update - :mobile/toolbar-update-observer 0 + :mobile/toolbar-update-observer 0 :mobile/show-tabbar? false ;; plugin @@ -1190,9 +1190,13 @@ (set-state! :ui/shortcut-tooltip? (not mode)) (storage/set :ui/shortcut-tooltip? (not mode)))) +(defn mobile? + [] + (or (util/mobile?) (mobile-util/native-platform?))) + (defn enable-tooltip? [] - (if (or (util/mobile?) (mobile-util/native-platform?)) + (if (mobile?) false (get (get (sub-config) (get-current-repo)) :ui/enable-tooltip?