Merge branch 'fix/bug-chat-notification-login-logout' into 'main'

Fix/bug chat notification login logout

See merge request jjimenez/safekat!470
This commit is contained in:
Alvaro
2025-01-11 10:48:48 +00:00
2 changed files with 13 additions and 7 deletions

View File

@ -280,7 +280,7 @@ $picture = "/assets/img/default-user.png";
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item" href="<?= site_url("logout") ?>">
<a class="dropdown-item" id="btn-log-out" href="<?= site_url("logout") ?>">
<i class="ti ti-logout me-2 ti-sm"></i>
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
</a>

View File

@ -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")
})
})