From ba009a399b04e0257811e0e013532c47b12fa56f Mon Sep 17 00:00:00 2001 From: marc2332 Date: Thu, 5 Oct 2023 18:18:21 +0200 Subject: [PATCH] fix: Fixes --- .../views/UpdateStrongholdView.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/desktop/views/update-stronghold/views/UpdateStrongholdView.svelte b/packages/desktop/views/update-stronghold/views/UpdateStrongholdView.svelte index 833716e9788..0c8c81feb1d 100644 --- a/packages/desktop/views/update-stronghold/views/UpdateStrongholdView.svelte +++ b/packages/desktop/views/update-stronghold/views/UpdateStrongholdView.svelte @@ -17,6 +17,7 @@ export let password: string = '' export let isRecovery: boolean = false + let parsedError = null let passwordError: string = '' let isBusy = false @@ -44,12 +45,15 @@ handleError(err) isBusy = false const message = err?.message ?? '' - const parsedError = isValidJson(message) ? JSON.parse(message) : '' - passwordError = parsedError?.payload?.error.replaceAll('`', '') ?? localize(message) - if(passwordError.trim() == "stronghold migration error: input snapshot has incorrect/unexpected version"){ + parsedError = isValidJson(message) ? JSON.parse(message) : '' + const error = parsedError?.payload?.error.replaceAll('`', '') ?? localize(message) + if(error.includes("input unexpected")){ $onboardingProfile.strongholdVersion = StrongholdVersion.V3; + emitStrongholdMigrationEvent({ success: true }) $updateStrongholdRouter.next() return + } else { + passwordError = error } emitStrongholdMigrationEvent({ success: false, onboardingType }) return @@ -76,6 +80,7 @@
+

{JSON.stringify(parsedError)}