From 16695daf2cc4603cb37fe55bdb7488ef1c9ff405 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 31 Mar 2025 16:41:45 +0700 Subject: [PATCH 1/2] loop noti --- src/views/MainLayout.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 2e379f946..3231a8487 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -233,7 +233,7 @@ const activeBtn = () => { }; const isSsoToken = ref(false); - +const interval = ref(null); /** * เมื่อเริ่มต้นโปรแกรมให้ฟัง event resize และ function myEventHandler * set function myEventHandler เพราะ state ยังไม่เซ็ท , state เซ็ทเมื่อ หน้าจอเริ่ม ขยับหน้าจอ @@ -256,7 +256,12 @@ onMounted(async () => { await fetchroleUser(user.role); } - await fetchmsgNoread(); + + fetchmsgNoread(); + // fetch noread noti every 15 seconds + interval.value = setInterval(() => { + fetchmsgNoread(); + }, 15000); myEventHandler(null, false); window.addEventListener("resize", (e: any) => { @@ -271,6 +276,9 @@ onUnmounted(() => { window.removeEventListener("resize", (e: any) => { myEventHandler(e, true); }); + if (interval.value) { + clearInterval(interval.value); + } }); /** From dbb9e5719bdfa00ff26c511f37aca3b9bb202f4b Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 31 Mar 2025 18:00:16 +0700 Subject: [PATCH 2/2] =?UTF-8?q?fix=20bug=20=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/components/DialogInfoMain.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index b9608ed92..45ba2ca75 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -86,7 +86,11 @@ async function fetchProfile(id: string, avatarName: string) { * function rediract ไปทะเบียนประวัติ */ function redirecToRegistry() { - router.push(`/registry-officer${props.employeeClass}/${profileId.value}`); + router.push( + `/registry${props.employeeClass ? props.employeeClass : "-officer"}/${ + profileId.value + }` + ); modal.value = false; } @@ -228,5 +232,4 @@ watch( - +