chore: explicitly share error message used for logic

This commit is contained in:
2025-09-01 06:42:00 -06:00
parent 1499211018
commit fa8956fb38
2 changed files with 5 additions and 2 deletions

View File

@@ -92,6 +92,7 @@ import {
retrieveAccountCount,
importFromMnemonic,
checkForDuplicateAccount,
DUPLICATE_ACCOUNT_ERROR,
} from "../libs/util";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
@@ -245,7 +246,7 @@ export default class ImportAccountView extends Vue {
// Check if this is a duplicate account error from saveNewIdentity
const errorMessage =
error instanceof Error ? error.message : String(error);
if (errorMessage.includes("Cannot import duplicate account")) {
if (errorMessage.includes(DUPLICATE_ACCOUNT_ERROR)) {
this.notify.warning(
NOTIFY_DUPLICATE_ACCOUNT_IMPORT.message,
TIMEOUTS.LONG,