refactor: simplify duplicate account error detection

Replace dual string check with single unique identifier for more precise error handling
This commit is contained in:
Jose Olarte III
2025-09-01 20:03:17 +08:00
parent 25e37cc415
commit 1499211018

View File

@@ -245,10 +245,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("already exists") &&
errorMessage.includes("Cannot import duplicate account")
) {
if (errorMessage.includes("Cannot import duplicate account")) {
this.notify.warning(
NOTIFY_DUPLICATE_ACCOUNT_IMPORT.message,
TIMEOUTS.LONG,