forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor: move duplicate account import warnings to notification constants
- Add NOTIFY_DUPLICATE_ACCOUNT_IMPORT constant for import warnings - Add NOTIFY_DUPLICATE_DERIVED_ACCOUNT constant for derived account warnings - Update ImportAccountView.vue to use notification constants - Update ImportDerivedAccountView.vue to use notification constants - Update test file to use notification constants for assertions Centralizes notification messages for better maintainability and consistency with the existing notification system. Files modified: - src/constants/notifications.ts: Add new notification constants - src/views/ImportAccountView.vue: Replace hardcoded messages with constants - src/views/ImportDerivedAccountView.vue: Replace hardcoded messages with constants - test-playwright/duplicate-import-test.spec.ts: Update test assertions
This commit is contained in:
@@ -95,6 +95,7 @@ import {
|
||||
import { retrieveAccountCount, importFromMnemonic } from "../libs/util";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
||||
import { NOTIFY_DUPLICATE_ACCOUNT_IMPORT } from "@/constants/notifications";
|
||||
|
||||
/**
|
||||
* Import Account View Component
|
||||
@@ -206,7 +207,7 @@ export default class ImportAccountView extends Vue {
|
||||
const isDuplicate = await this.checkForDuplicateAccount();
|
||||
if (isDuplicate) {
|
||||
this.notify.warning(
|
||||
"This account has already been imported. Please use a different seed phrase or check your existing accounts.",
|
||||
NOTIFY_DUPLICATE_ACCOUNT_IMPORT.message,
|
||||
TIMEOUTS.LONG,
|
||||
);
|
||||
return;
|
||||
@@ -246,7 +247,7 @@ export default class ImportAccountView extends Vue {
|
||||
errorMessage.includes("Cannot import duplicate account")
|
||||
) {
|
||||
this.notify.warning(
|
||||
"This account has already been imported. Please use a different seed phrase or check your existing accounts.",
|
||||
NOTIFY_DUPLICATE_ACCOUNT_IMPORT.message,
|
||||
TIMEOUTS.LONG,
|
||||
);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user