feat: redesign notifications settings with per-category in-app/push table
- Add notify_new_chapters_push field to AppUser, PATCH /api/profile, and profile loader - Fix bell panel to reload notifications on every open (not just once on mount) - Replace flat in-app + push toggles with structured category table (Category | In-app | Push) - Add browser push master subscribe/unsubscribe row above the table - Push column toggle disabled until browser is subscribed; shows — when unsupported/denied - Update Notifications row hint to summarise active channels (In-app · Push / Off)
This commit is contained in:
@@ -96,6 +96,7 @@ export interface User {
|
||||
polar_customer_id?: string;
|
||||
polar_subscription_id?: string;
|
||||
notify_new_chapters?: boolean;
|
||||
notify_new_chapters_push?: boolean;
|
||||
}
|
||||
|
||||
// ─── Auth token cache ─────────────────────────────────────────────────────────
|
||||
@@ -1582,7 +1583,10 @@ export async function updateUserAvatarUrl(userId: string, avatarUrl: string): Pr
|
||||
*/
|
||||
export async function updateUserNotificationPrefs(
|
||||
userId: string,
|
||||
prefs: { notify_new_chapters?: boolean }
|
||||
prefs: {
|
||||
notify_new_chapters?: boolean;
|
||||
notify_new_chapters_push?: boolean;
|
||||
}
|
||||
): Promise<void> {
|
||||
const token = await getToken();
|
||||
const res = await fetch(`${PB_URL}/api/collections/app_users/records/${userId}`, {
|
||||
|
||||
Reference in New Issue
Block a user