diff --git a/desk/src/components/SidebarLink.vue b/desk/src/components/SidebarLink.vue index 0073c1440..4b0ce38fd 100644 --- a/desk/src/components/SidebarLink.vue +++ b/desk/src/components/SidebarLink.vue @@ -8,7 +8,7 @@ [bgColor]: isActive, [hvColor]: !isActive, }" - @click="handle" + @click="handleNavigation" > (), { isActive: false, - onClick: () => () => true, + onClick: () => {}, to: "", bgColor: "bg-white", hvColor: "hover:bg-gray-100", }); const router = useRouter(); -function handle() { +function handleNavigation() { props.onClick(); - if (props.to) { - router.push({ - name: props.to, - }); - } + if (router.currentRoute.value.name === props.to) return; + router.push({ + name: props.to, + }); } diff --git a/desk/src/components/knowledge-base-v2/KnowledgeBaseCategory.vue b/desk/src/components/knowledge-base-v2/KnowledgeBaseCategory.vue index 9719db900..3618c00b1 100644 --- a/desk/src/components/knowledge-base-v2/KnowledgeBaseCategory.vue +++ b/desk/src/components/knowledge-base-v2/KnowledgeBaseCategory.vue @@ -169,7 +169,7 @@ function handleSubCategoryClick(subCategory: SubCategory) { }, }); categoryTreeResource.reload(); - router.push({ + router.replace({ query: { category: categoryTreeResource.data.root_category.category_id, subCategory: subCategory.name, diff --git a/desk/src/components/layouts/Sidebar.vue b/desk/src/components/layouts/Sidebar.vue index 9d3d1061b..1d90a59f1 100644 --- a/desk/src/components/layouts/Sidebar.vue +++ b/desk/src/components/layouts/Sidebar.vue @@ -74,7 +74,7 @@ import { storeToRefs } from "pinia"; import { useAuthStore } from "@/stores/auth"; import { useNotificationStore } from "@/stores/notification"; import { useSidebarStore } from "@/stores/sidebar"; -import { CUSTOMER_PORTAL_LANDING, CUSTOMER_PORTAL_ROUTES } from "@/router"; +import { CUSTOMER_PORTAL_LANDING } from "@/router"; import { useDevice } from "@/composables"; import { SidebarLink } from "@/components"; import UserMenu from "@/components/UserMenu.vue"; diff --git a/desk/src/index.css b/desk/src/index.css index f033b3322..9bdf9e06f 100644 --- a/desk/src/index.css +++ b/desk/src/index.css @@ -36,3 +36,8 @@ shadow-2xl } } + +/* input tye text */ +input[type="text"] { + border: none; +} diff --git a/desk/src/pages/ticket/TicketConversation.vue b/desk/src/pages/ticket/TicketConversation.vue index 6b330d2d1..ab2055bcf 100644 --- a/desk/src/pages/ticket/TicketConversation.vue +++ b/desk/src/pages/ticket/TicketConversation.vue @@ -15,7 +15,7 @@ class="w-full activity grid grid-cols-[30px_minmax(auto,_1fr)] gap-2 sm:gap-4" >
{ const authStore = useAuthStore(); - const userStore = useUserStore(); - if (authStore.isLoggedIn) { await authStore.init(); - await userStore.users.fetch(); } if (!authStore.isLoggedIn) { @@ -246,3 +243,11 @@ router.beforeEach(async (to, _, next) => { next(); } }); + +router.afterEach(async (to) => { + const userStore = useUserStore(); + const isCustomerPortal = to.meta.public ?? false; + if (!isCustomerPortal) { + await userStore.users.fetch(); + } +});