diff --git a/src/components/NotificationSection.vue b/src/components/NotificationSection.vue new file mode 100644 index 00000000..32c67bac --- /dev/null +++ b/src/components/NotificationSection.vue @@ -0,0 +1,212 @@ + + + diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 1cb9be94..aa34ea5d 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -60,88 +60,14 @@ @share-info="onShareInfo" /> -
-

Notifications

-
-
- Reminder Notification - -
-
- - - -
- -
-
-
-
- Message: "{{ notifyingReminderMessage }}" - {{ notifyingReminderTime.replace(" ", " ") }} -
-
- -
- New Activity Notification - -
- -
- - - -
- -
-
-
-
- {{ notifyingNewActivityTime.replace(" ", " ") }} -
-
- - Troubleshoot your notifications… - -
-
- + @@ -759,12 +685,13 @@ import { Capacitor } from "@capacitor/core"; import EntityIcon from "../components/EntityIcon.vue"; import ImageMethodDialog from "../components/ImageMethodDialog.vue"; -import PushNotificationPermission from "../components/PushNotificationPermission.vue"; + import QuickNav from "../components/QuickNav.vue"; import TopMessage from "../components/TopMessage.vue"; import UserNameDialog from "../components/UserNameDialog.vue"; import DataExportSection from "../components/DataExportSection.vue"; import IdentitySection from "@/components/IdentitySection.vue"; +import NotificationSection from "@/components/NotificationSection.vue"; import RegistrationNotice from "@/components/RegistrationNotice.vue"; import LocationSearchSection from "@/components/LocationSearchSection.vue"; import UsageLimitsSection from "@/components/UsageLimitsSection.vue"; @@ -790,11 +717,7 @@ import { getHeaders, tokenExpiryTimeDescription, } from "../libs/endorserServer"; -import { - DAILY_CHECK_TITLE, - DIRECT_PUSH_TITLE, - retrieveAccountMetadata, -} from "../libs/util"; +import { retrieveAccountMetadata } from "../libs/util"; import { logger } from "../utils/logger"; import { PlatformServiceMixin } from "../utils/PlatformServiceMixin"; import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; @@ -823,7 +746,7 @@ interface UserNameDialogRef { LMap, LMarker, LTileLayer, - PushNotificationPermission, + NotificationSection, QuickNav, TopMessage, UserNameDialog, @@ -1102,87 +1025,6 @@ export default class AccountViewView extends Vue { } } - async showNewActivityNotificationInfo(): Promise { - this.notify.confirm( - ACCOUNT_VIEW_CONSTANTS.NOTIFICATIONS.NEW_ACTIVITY_INFO, - async () => { - await (this.$router as Router).push({ - name: "help-notification-types", - }); - }, - ); - } - - async showNewActivityNotificationChoice(): Promise { - if (!this.notifyingNewActivity) { - ( - this.$refs.pushNotificationPermission as PushNotificationPermission - ).open(DAILY_CHECK_TITLE, async (success: boolean, timeText: string) => { - if (success) { - await this.$saveSettings({ - notifyingNewActivityTime: timeText, - }); - this.notifyingNewActivity = true; - this.notifyingNewActivityTime = timeText; - } - }); - } else { - this.notify.notificationOff(DAILY_CHECK_TITLE, async (success) => { - if (success) { - await this.$saveSettings({ - notifyingNewActivityTime: "", - }); - this.notifyingNewActivity = false; - this.notifyingNewActivityTime = ""; - } - }); - } - } - - async showReminderNotificationInfo(): Promise { - this.notify.confirm( - ACCOUNT_VIEW_CONSTANTS.NOTIFICATIONS.REMINDER_INFO, - async () => { - await (this.$router as Router).push({ - name: "help-notification-types", - }); - }, - ); - } - - async showReminderNotificationChoice(): Promise { - if (!this.notifyingReminder) { - ( - this.$refs.pushNotificationPermission as PushNotificationPermission - ).open( - DIRECT_PUSH_TITLE, - async (success: boolean, timeText: string, message?: string) => { - if (success) { - await this.$saveSettings({ - notifyingReminderMessage: message, - notifyingReminderTime: timeText, - }); - this.notifyingReminder = true; - this.notifyingReminderMessage = message || ""; - this.notifyingReminderTime = timeText; - } - }, - ); - } else { - this.notify.notificationOff(DIRECT_PUSH_TITLE, async (success) => { - if (success) { - await this.$saveSettings({ - notifyingReminderMessage: "", - notifyingReminderTime: "", - }); - this.notifyingReminder = false; - this.notifyingReminderMessage = ""; - this.notifyingReminderTime = ""; - } - }); - } - } - public async toggleHideRegisterPromptOnNewContact(): Promise { const newSetting = !this.hideRegisterPromptOnNewContact; await this.$saveSettings({