From 114627b218a6984a9ed0dc4f31f70bea395bc283 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Mon, 7 Jul 2025 07:02:33 +0000 Subject: [PATCH] Replace hardcoded notification strings with standardized constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace literal strings with notification constants in ContactsView.vue: * "Got an error sending the invite." → NOTIFY_INVITE_ERROR.message * "Could not set visibility on the server." → NOTIFY_VISIBILITY_ERROR.message * "Unconfirmed Hours" → NOTIFY_UNCONFIRMED_HOURS.title - Remove unused NOTIFY_REGISTER_PROCESSING import - Remove unused NOTIFICATION_TIMEOUTS constant in ShareMyContactInfoView.vue - Fix unused parameter warnings in danger() and warning() methods - Resolve all notification-related linting errors --- src/components/MembersList.vue | 9 ++-- src/components/TopMessage.vue | 7 +-- src/components/UserNameDialog.vue | 1 - src/constants/notifications.ts | 3 +- src/views/ClaimAddRawView.vue | 12 ++--- src/views/ContactGiftingView.vue | 2 +- src/views/ContactImportView.vue | 2 +- src/views/ContactsView.vue | 55 +++++--------------- src/views/NewActivityView.vue | 7 ++- src/views/ProjectViewView.vue | 17 ++---- src/views/RecentOffersToUserProjectsView.vue | 2 +- src/views/RecentOffersToUserView.vue | 2 +- src/views/ShareMyContactInfoView.vue | 11 +--- 13 files changed, 37 insertions(+), 93 deletions(-) diff --git a/src/components/MembersList.vue b/src/components/MembersList.vue index f29472c1..b2a0106b 100644 --- a/src/components/MembersList.vue +++ b/src/components/MembersList.vue @@ -211,7 +211,7 @@ interface DecryptedMember { }) export default class MembersList extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; - + notify!: ReturnType; libsUtil = libsUtil; @@ -231,7 +231,7 @@ export default class MembersList extends Vue { async created() { this.notify = createNotifyHelpers(this.$notify); - + const settings = await this.$accountSettings(); this.activeDid = settings.activeDid || ""; this.apiServer = settings.apiServer || ""; @@ -505,10 +505,7 @@ export default class MembersList extends Vue { if (err instanceof Error && err.message?.indexOf("already exists") > -1) { message = "This person is already in your contact list."; } - this.notify.error( - message, - TIMEOUTS.LONG, - ); + this.notify.error(message, TIMEOUTS.LONG); } } } diff --git a/src/components/TopMessage.vue b/src/components/TopMessage.vue index 24c2aa40..519a0585 100644 --- a/src/components/TopMessage.vue +++ b/src/components/TopMessage.vue @@ -40,7 +40,7 @@ export default class TopMessage extends Vue { async mounted() { this.notify = createNotifyHelpers(this.$notify); - + try { // Ultra-concise cached settings loading - replaces 50+ lines of logic! const settings = await this.$accountSettings(undefined, { @@ -62,10 +62,7 @@ export default class TopMessage extends Vue { this.message = "You are using prod, user " + didPrefix; } } catch (err: unknown) { - this.notify.error( - JSON.stringify(err), - TIMEOUTS.MODAL, - ); + this.notify.error(JSON.stringify(err), TIMEOUTS.MODAL); } } } diff --git a/src/components/UserNameDialog.vue b/src/components/UserNameDialog.vue index 2aaabacd..f4d314ab 100644 --- a/src/components/UserNameDialog.vue +++ b/src/components/UserNameDialog.vue @@ -37,7 +37,6 @@