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:
Jose Olarte III
2025-08-28 16:44:17 +08:00
parent f51408e32a
commit c4f2bb5e3a
5 changed files with 41 additions and 13 deletions

View File

@@ -91,6 +91,7 @@ import { createNotifyHelpers, TIMEOUTS, NotifyFunction } from "@/utils/notify";
import {
NOTIFY_ACCOUNT_DERIVATION_SUCCESS,
NOTIFY_ACCOUNT_DERIVATION_ERROR,
NOTIFY_DUPLICATE_DERIVED_ACCOUNT,
} from "@/constants/notifications";
@Component({
@@ -175,7 +176,7 @@ export default class ImportAccountView extends Vue {
const isDuplicate = await this.checkForDuplicateAccount(newId.did);
if (isDuplicate) {
this.notify.warning(
"This derived account already exists. Please try a different derivation path.",
NOTIFY_DUPLICATE_DERIVED_ACCOUNT.message,
TIMEOUTS.LONG,
);
return;