@@ -53,7 +53,15 @@ class WalletAction {
5353 * @param {number } options.index The seed index
5454 */
5555 setRestoreSeed ( { word, index } ) {
56- this . _store . wallet . restoreSeed [ index ] = word ;
56+ this . _store . seedMnemonic [ index ] = word ;
57+ }
58+
59+ /**
60+ * Set which seed restore input is in focus.
61+ * @param {number } options.index The index of the input.
62+ */
63+ setFocusedRestoreInd ( { index } ) {
64+ this . _store . wallet . focusedRestoreInd = index ;
5765 }
5866
5967 //
@@ -212,6 +220,7 @@ class WalletAction {
212220 }
213221 await this . initWallet ( {
214222 walletPassword : newPassword ,
223+ recoveryWindow : this . _store . settings . restoring ? RECOVERY_WINDOW : 0 ,
215224 seedMnemonic : this . _store . seedMnemonic . toJSON ( ) ,
216225 } ) ;
217226 }
@@ -311,6 +320,7 @@ class WalletAction {
311320 * @return {undefined }
312321 */
313322 initRestoreWallet ( ) {
323+ this . _store . seedMnemonic = Array ( 24 ) . fill ( '' ) ;
314324 this . _store . wallet . restoreIndex = 0 ;
315325 this . _nav . goRestoreSeed ( ) ;
316326 }
@@ -324,8 +334,9 @@ class WalletAction {
324334 initNextRestorePage ( ) {
325335 if ( this . _store . wallet . restoreIndex < 21 ) {
326336 this . _store . wallet . restoreIndex += 3 ;
337+ this . _store . wallet . focusedRestoreInd = this . _store . wallet . restoreIndex ;
327338 } else {
328- this . _nav . goRestorePassword ( ) ;
339+ this . initSetPassword ( ) ;
329340 }
330341 }
331342
@@ -337,6 +348,7 @@ class WalletAction {
337348 initPrevRestorePage ( ) {
338349 if ( this . _store . wallet . restoreIndex >= 3 ) {
339350 this . _store . wallet . restoreIndex -= 3 ;
351+ this . _store . wallet . focusedRestoreInd = this . _store . wallet . restoreIndex ;
340352 } else {
341353 this . _nav . goSelectSeed ( ) ;
342354 }
@@ -375,20 +387,6 @@ class WalletAction {
375387 await this . unlockWallet ( { walletPassword : password } ) ;
376388 }
377389
378- /**
379- * Initialize the wallet with the password input the seed that was already
380- * inputted, and the default recovery window.
381- * @return {Promise<undefined> }
382- */
383- async restoreWallet ( ) {
384- const { password, restoreSeed } = this . _store . wallet ;
385- await this . initWallet ( {
386- walletPassword : password ,
387- seedMnemonic : restoreSeed . toJSON ( ) ,
388- recoveryWindow : RECOVERY_WINDOW ,
389- } ) ;
390- }
391-
392390 /**
393391 * Unlock the wallet by calling the grpc api with the user chosen password.
394392 * @param {string } options.walletPassword The password used to encrypt the wallet
0 commit comments