Longer linger for web push mobile error

This commit is contained in:
Jack Kingsman
2026-04-19 23:04:36 -07:00
parent 6b81dd3082
commit 5f78294cd1
2 changed files with 7 additions and 3 deletions

View File

@@ -224,6 +224,7 @@ export function usePushSubscription(): PushSubscriptionState {
console.error('Push subscribe failed:', err);
toast.error('Failed to enable push notifications', {
description: err instanceof Error ? err.message : 'Check that notifications are allowed',
duration: 8_000,
});
return null;
} finally {

View File

@@ -171,9 +171,12 @@ describe('usePushSubscription', () => {
});
expect(result.current.loading).toBe(false);
expect(mocks.toast.error).toHaveBeenCalledWith('Failed to enable push notifications', {
description: expect.stringContaining('trusted TLS certificate for service workers'),
});
expect(mocks.toast.error).toHaveBeenCalledWith(
'Failed to enable push notifications',
expect.objectContaining({
description: expect.stringContaining('trusted TLS certificate for service workers'),
})
);
}, 5_000);
it('recreates a stale browser subscription when the server VAPID key changed', async () => {