Vitron-Front/app/hooks
fazli c4e0f2f89f fix(push): timeout every await + iOS-not-PWA early exit so subscribe never wedges
The subscribe/disable flow awaited several browser APIs that on certain
devices — most reliably iOS Safari in a non-installed PWA — return a
Promise that never resolves or rejects (requestPermission, serviceWorker
.ready, pushManager.subscribe). When any of them hung, the try/finally
never ran, so `busy` stayed true forever: the dashboard nudge button
stuck at "..." and the settings toggle refused to flip.

Every awaited step is now wrapped in withTimeout(15s). Failures surface
as toasts instead of silent hangs (subscribe success, permission denied,
generic error). iOS Safari without the site installed to home screen —
where Web Push physically cannot work — short-circuits with an
add-to-home-screen instruction before we ever try, so we don't burn a
timeout waiting for a doomed subscribe().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-19 15:33:04 +00:00
..
use-prefetch.ts first 2026-04-29 01:44:16 +03:30
use-root-data.ts first 2026-04-29 01:44:16 +03:30
use-toast.ts first 2026-04-29 01:44:16 +03:30
useBadgeCounts.ts fix(notif+auth): camelCase badge fields, seller push prompt, only 401 signs out 2026-07-18 13:18:08 +00:00
useCarousel.ts first 2026-04-29 01:44:16 +03:30
useDebounce.ts first 2026-04-29 01:44:16 +03:30
usePushNotifications.ts fix(push): timeout every await + iOS-not-PWA early exit so subscribe never wedges 2026-07-19 15:33:04 +00:00
useStoreOwnership.ts fix(store): don't bounce owners home, stop cross-user myStores cache 2026-07-18 13:18:23 +00:00
useWebSocket.ts feat(chat+push): image attachments, day-labeled inbox with reply state, sub self-heal 2026-07-19 13:22:44 +00:00