fix(@desktop/wallet): not remove seed phrases when changing number of words in wallet section

Fix #5613
This commit is contained in:
Michal Iskierko 2022-05-25 15:36:42 +02:00 committed by Iuri Matias
parent b2d75995e4
commit eb12d9f7cd
1 changed files with 11 additions and 2 deletions

View File

@ -79,7 +79,17 @@ GridView {
onModelChanged: {
mnemonicString = "";
_internal.mnemonicInput = [];
let menmonicInputTemp = _internal.mnemonicInput.filter(function(value) {
return value.pos <= grid.count
})
_internal.mnemonicInput = []
for (let i = 0; i < menmonicInputTemp.length; i++) {
// .pos starts with 1
grid.itemAtIndex(menmonicInputTemp[i].pos - 1).setWord(menmonicInputTemp[i].seed)
grid.addWord(menmonicInputTemp[i].pos,
menmonicInputTemp[i].seed,
true)
}
}
@ -162,7 +172,6 @@ GridView {
width: _internal.seedPhraseInputWidth
height: _internal.seedPhraseInputHeight
textEdit.errorMessageCmp.visible: false
textEdit.input.anchors.topMargin: 11
leftComponentText: index + 1
inputList: BIP39_en { }
property int itemIndex: index