fix(notifications): clear scheduled notifications before refresh apply
Cancel all native notifications before applying the backend-provided schedule so refreshNotifications always performs a full replacement and never leaves stale entries behind.
This commit is contained in:
@@ -585,6 +585,10 @@ export async function refreshNotifications(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
// Full replacement: clear prior scheduled notifications before applying backend schedule.
|
||||
// (Plugin API name is cancelAllNotifications; equivalent intent to "clearAllNotifications".)
|
||||
await DailyNotification.cancelAllNotifications();
|
||||
|
||||
// Apply backend schedule to the native scheduler as recurring notifications.
|
||||
// The plugin's schedule API is cron/clockTime-based (recurring), so we map
|
||||
// the backend timestamps to clockTime (HH:mm) schedules.
|
||||
|
||||
Reference in New Issue
Block a user