forked from jsnbuchanan/crowd-funder-for-time-pwa
Replace hardcoded notification strings with standardized constants
- 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
This commit is contained in:
@@ -211,7 +211,7 @@ interface DecryptedMember {
|
||||
})
|
||||
export default class MembersList extends Vue {
|
||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||
|
||||
|
||||
notify!: ReturnType<typeof createNotifyHelpers>;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
<script lang="ts">
|
||||
import { Vue, Component, Prop } from "vue-facing-decorator";
|
||||
|
||||
|
||||
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
|
||||
Reference in New Issue
Block a user