diff --git a/app/hooks/usePushNotifications.ts b/app/hooks/usePushNotifications.ts index e3193c6..f95f367 100644 --- a/app/hooks/usePushNotifications.ts +++ b/app/hooks/usePushNotifications.ts @@ -198,10 +198,13 @@ export function usePushNotifications() { return ok; } catch (e) { console.error("Push subscribe failed:", e); - // Anything unexpected — surface it so the seller knows to retry. + // Include the step name / error text in the toast so field debugging + // doesn't need browser console access — sellers can read out what + // failed to whoever's helping them. + const detail = e instanceof Error ? e.message : String(e); toast({ title: "فعال‌سازی اعلان با خطا مواجه شد", - description: "لطفاً چند لحظه بعد دوباره تلاش کنید.", + description: `${detail || "خطای ناشناخته"}. لطفاً چند لحظه بعد دوباره تلاش کنید.`, variant: "destructive", }); return false;