"Push-notification-diagnostics-enhancement"
This commit is contained in:
@@ -113,6 +113,30 @@ class AdminNotificationManager {
|
||||
// Complete setup
|
||||
await this.setupOrderNotifications();
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to enable notifications:', error);
|
||||
|
||||
// Show enhanced error message with diagnostics
|
||||
let errorMessage = '❌ Failed to enable push notifications.\n\n';
|
||||
|
||||
if (error.message.includes('timed out') && error.message.includes('FCM')) {
|
||||
errorMessage += '🔗 Network Issue Detected:\n';
|
||||
errorMessage += 'Your browser cannot connect to Chrome\'s push notification service (FCM). ';
|
||||
errorMessage += 'This commonly happens with:\n';
|
||||
errorMessage += '• Corporate firewalls or VPNs\n';
|
||||
errorMessage += '• Network security software\n';
|
||||
errorMessage += '• Restricted internet connections\n\n';
|
||||
errorMessage += '💡 Workarounds:\n';
|
||||
errorMessage += '• Try from a different network\n';
|
||||
errorMessage += '• Disable VPN temporarily\n';
|
||||
errorMessage += '• Contact your IT department\n';
|
||||
errorMessage += '• Use a mobile hotspot to test\n\n';
|
||||
errorMessage += 'The admin panel will still work normally - you just won\'t receive push notifications.';
|
||||
} else {
|
||||
errorMessage += `Error: ${error.message}`;
|
||||
}
|
||||
|
||||
this.showNotificationError(errorMessage);
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
button.innerHTML = originalText;
|
||||
|
||||
Reference in New Issue
Block a user