diff --git a/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue index 81555067c..32dc2874d 100644 --- a/src/components/common/RightMenu.vue +++ b/src/components/common/RightMenu.vue @@ -2,9 +2,10 @@ import { ref, onMounted, useSlots } from 'vue'; import { useI18n } from 'vue-i18n'; import { useStateStore } from 'stores/useStateStore'; -import isMobile from 'src/composables/isMobile'; +import { useQuasar } from 'quasar'; const { t } = useI18n(); +const quasar = useQuasar(); const stateStore = useStateStore(); const slots = useSlots(); const hasContent = ref(false); @@ -23,7 +24,7 @@ onMounted(() => { childList: true, attributes: true, }); - if ((!slots['right-panel'] && !hasContent.value) || isMobile) + if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile) stateStore.rightDrawer = false; }); diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 133ba7f21..24c9c18df 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -52,7 +52,7 @@ onBeforeMount(async () => { }); onMounted(() => { - stateStore.rightMenu = false; + stateStore.rightDrawerChangeValue(false); console.log('useStateStore: ', useStateStore.rightMenu); }); async function fetch() { diff --git a/src/composables/isMobile.js b/src/composables/isMobile.js deleted file mode 100644 index 36f82694a..000000000 --- a/src/composables/isMobile.js +++ /dev/null @@ -1,3 +0,0 @@ -const regex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i; -const isMobile = regex.test(navigator.userAgent); -export default isMobile; diff --git a/src/pages/Item/ItemList.vue b/src/pages/Item/ItemList.vue index 657709a9e..a1b22c00b 100644 --- a/src/pages/Item/ItemList.vue +++ b/src/pages/Item/ItemList.vue @@ -2,7 +2,6 @@ import { onMounted, ref, computed, reactive, onUnmounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; -import isMobile from 'src/composables/isMobile'; import FetchData from 'components/FetchData.vue'; import FetchedTags from 'components/ui/FetchedTags.vue'; diff --git a/src/stores/useStateStore.js b/src/stores/useStateStore.js index 328df9978..686e76c77 100644 --- a/src/stores/useStateStore.js +++ b/src/stores/useStateStore.js @@ -15,6 +15,10 @@ export const useStateStore = defineStore('stateStore', () => { rightDrawer.value = !rightDrawer.value; } + function rightDrawerChangeValue(value) { + rightDrawer.value = value; + } + function toggleSubToolbar() { subToolbar.value = !subToolbar.value; } @@ -50,5 +54,6 @@ export const useStateStore = defineStore('stateStore', () => { isRightDrawerShown, isSubToolbarShown, toggleSubToolbar, + rightDrawerChangeValue, }; });