diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 4130a980..a4130636 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -104,10 +104,17 @@ :aria-checked="notifyingReminder" aria-label="Toggle reminder notifications" tabindex="0" - @click="showReminderNotificationChoice()" + @click.stop.prevent="showReminderNotificationChoice()" > - +
@@ -1220,17 +1227,57 @@ export default class AccountViewView extends Vue { }, ); } else { - this.notify.notificationOff(DIRECT_PUSH_TITLE, async (success) => { - if (success) { - await this.$saveSettings({ - notifyingReminderMessage: "", - notifyingReminderTime: "", - }); - this.notifyingReminder = false; - this.notifyingReminderMessage = ""; - this.notifyingReminderTime = ""; - } - }); + // On native platforms, handle notification cancellation directly + // (bypassing web push unsubscribe flow which doesn't work on native) + if (this.isNativePlatform) { + // Show confirmation dialog + this.notify.confirm( + `Would you like to turn off ${DIRECT_PUSH_TITLE}?`, + async () => { + try { + // Cancel the native notification + const service = NotificationService.getInstance(); + await service.cancelDailyNotification(); + + // Update settings and state + await this.$saveSettings({ + notifyingReminderMessage: "", + notifyingReminderTime: "", + }); + this.notifyingReminder = false; + this.notifyingReminderMessage = ""; + this.notifyingReminderTime = ""; + + this.notify.success( + `${DIRECT_PUSH_TITLE} has been turned off.`, + TIMEOUTS.STANDARD, + ); + } catch (error) { + logger.error( + "[AccountViewView] Error canceling native notification:", + error, + ); + this.notify.error( + "Failed to turn off notification. Please try again.", + TIMEOUTS.STANDARD, + ); + } + }, + ); + } else { + // Web platform: use existing web push unsubscribe flow + this.notify.notificationOff(DIRECT_PUSH_TITLE, async (success) => { + if (success) { + await this.$saveSettings({ + notifyingReminderMessage: "", + notifyingReminderTime: "", + }); + this.notifyingReminder = false; + this.notifyingReminderMessage = ""; + this.notifyingReminderTime = ""; + } + }); + } } }