From 4842356f8d4e949252db6b6d8f1abb73c84d7c4d Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sat, 11 Jan 2025 11:46:34 +0100 Subject: [PATCH] bug chat notification when logout --- .../Views/themes/vuexy/main/defaultlayout.php | 2 +- .../js/safekat/pages/chatNotification.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ci4/app/Views/themes/vuexy/main/defaultlayout.php b/ci4/app/Views/themes/vuexy/main/defaultlayout.php index 0efeba1a..b4a4a642 100644 --- a/ci4/app/Views/themes/vuexy/main/defaultlayout.php +++ b/ci4/app/Views/themes/vuexy/main/defaultlayout.php @@ -280,7 +280,7 @@ $picture = "/assets/img/default-user.png";
  • - "> + "> diff --git a/httpdocs/assets/js/safekat/pages/chatNotification.js b/httpdocs/assets/js/safekat/pages/chatNotification.js index 5a9de17f..333dba83 100644 --- a/httpdocs/assets/js/safekat/pages/chatNotification.js +++ b/httpdocs/assets/js/safekat/pages/chatNotification.js @@ -1,10 +1,16 @@ -import {showNotificationMessages} from "../components/chat.js"; +import { showNotificationMessages } from "../components/chat.js"; -showNotificationMessages($("#chat-notification-list")) +$(() => { -setInterval(() => { - showNotificationMessages($("#chat-notification-list")) -},10000) -$("#message-notification-dropdown").on("click",(e) => { showNotificationMessages($("#chat-notification-list")) + const chatNotificationInterval = setInterval(() => { + showNotificationMessages($("#chat-notification-list")) + }, 10000) + $("#message-notification-dropdown").on("click", (e) => { + showNotificationMessages($("#chat-notification-list")) + }) + $("#btn-log-out").on("click",() => { + clearInterval(chatNotificationInterval) + console.log("CLEAR") + }) }) \ No newline at end of file