This commit is contained in:
lizandrogd
2026-01-21 15:03:27 -05:00
parent 0f882f6b40
commit 972dc80c78
2 changed files with 39 additions and 2 deletions
+8 -1
View File
@@ -550,10 +550,17 @@
async loadNotifications() {
try {
const resp = await fetch('api/get_notifications.php');
const resp = await fetch('api/get_notifications.php', { credentials: 'same-origin' });
if (resp.status === 401) {
console.warn('Notifications fetch: unauthorized (session may have expired)');
return;
}
const json = await resp.json();
console.debug('loadNotifications response:', json);
if (json && json.success && Array.isArray(json.data)) {
json.data.forEach(n => this.showNotificationToast(n));
} else if (json && json.success === false) {
console.warn('get_notifications returned error:', json.error || json);
}
} catch (e) {
console.error('Error loading notifications', e);