up
This commit is contained in:
+8
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user