Skip to content

Commit

Permalink
fix: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Oct 5, 2023
1 parent e25f977 commit ba009a3
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
export let password: string = ''
export let isRecovery: boolean = false
let parsedError = null
let passwordError: string = ''
let isBusy = false
Expand Down Expand Up @@ -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
Expand All @@ -76,6 +80,7 @@
</form>
</div>
<div slot="leftpane__action">
<p>{JSON.stringify(parsedError)}</p>
<Button
type={HTMLButtonType.Submit}
form="update-stronghold-form"
Expand Down

0 comments on commit ba009a3

Please sign in to comment.