Skip to content

Commit e6f7352

Browse files
committed
fix: wizard: qml: call checkIfLast in WCHaveSeed
When the user has already loaded a wallet in QML and tries to restore a new wallet `WCHaveSeed.qml` incorrectly shows a `Finish` button instead of a `Next` button and raises a KeyError if the user clicks on Finish instead of resolving the passphrase input view (regression from #10016). This happens because `last` of `have_seed` depends on `NewWalletWizard.is_single_password()` and NewWalletWizard.wants_ext(wizard_data). `is_single_password()` is true if a wallet is already loaded, while `wants_ext(wizard_data)` is false as `wants_ext()` depends on `seed_extend: True` in `wizard_data` which only gets set after `apply()` of `WCHaveSeed` gets called, however the evaluation of `WCHaveSeed` being the last view happens before the view is shown. By calling `checkIsLast()` in the validation timer of `WCHaveSeed` the `last` property gets set again after `apply()` has been called, so the view is guaranteed to correctly show either the `Finish` or `Next` button after a seed has been entered.
1 parent 186b8ec commit e6f7352

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

electrum/gui/qml/components/wizard/WCHaveSeed.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ WizardComponent {
224224
id: validationTimer
225225
interval: 500
226226
repeat: false
227-
onTriggered: checkValid()
227+
onTriggered: {
228+
checkValid()
229+
// checkIsLast depends on 'seed_extend'(_canPassphrase) getting set in apply()
230+
checkIsLast()
231+
}
228232
}
229233

230234
Component.onCompleted: {

0 commit comments

Comments
 (0)