fix(chatbot): hotfix to actually hide chatbot from users without chatbot perms.
This commit is contained in:
parent
d51fe6a7ae
commit
38714717d1
|
|
@ -6,15 +6,17 @@
|
||||||
import FooterBar from 'src/layouts/components/main-layout-footer-bar.vue';
|
import FooterBar from 'src/layouts/components/main-layout-footer-bar.vue';
|
||||||
import LeftDrawer from 'src/layouts/components/main-layout-left-drawer.vue';
|
import LeftDrawer from 'src/layouts/components/main-layout-left-drawer.vue';
|
||||||
import ChatbotDrawer from 'src/modules/chatbot/components/chatbot-drawer.vue';
|
import ChatbotDrawer from 'src/modules/chatbot/components/chatbot-drawer.vue';
|
||||||
|
|
||||||
import { onMounted, watch, ref } from 'vue';
|
import { onMounted, watch, ref } from 'vue';
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
import { useUiStore } from 'src/stores/ui-store';
|
import { useUiStore } from 'src/stores/ui-store';
|
||||||
|
import { useAuthStore } from 'src/stores/auth-store';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ui_store = useUiStore();
|
const ui_store = useUiStore();
|
||||||
|
const auth_store = useAuthStore();
|
||||||
const user_preferences = ref(ui_store.user_preferences);
|
const user_preferences = ref(ui_store.user_preferences);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (ui_store.user_preferences.id === -1) {
|
if (ui_store.user_preferences.id === -1) {
|
||||||
await ui_store.getUserPreferences();
|
await ui_store.getUserPreferences();
|
||||||
|
|
@ -27,7 +29,7 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await ui_store.getUserPreferences();
|
await ui_store.getUserPreferences();
|
||||||
}, {deep: true});
|
}, { deep: true });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -36,12 +38,12 @@
|
||||||
|
|
||||||
<LeftDrawer />
|
<LeftDrawer />
|
||||||
|
|
||||||
<ChatbotDrawer />
|
<ChatbotDrawer v-if="auth_store.user?.user_module_access.includes('chatbot')"/>
|
||||||
|
|
||||||
<q-page-container>
|
<q-page-container>
|
||||||
<router-view />
|
<router-view />
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
|
|
||||||
<FooterBar v-if="!$q.platform.is.mobile" />
|
<FooterBar v-if="!$q.platform.is.mobile" />
|
||||||
</q-layout>
|
</q-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user