@@ -38,6 +38,7 @@ import type { NavigationBase } from '../types/routerTypes'
3838import type { MapObject } from '../types/types'
3939import { getCurrencyCode , isKeysOnlyPlugin } from '../util/CurrencyInfoHelpers'
4040import { getWalletName } from '../util/CurrencyWalletHelpers'
41+ import { getMigrateWalletItemList } from '../util/getMigrateWalletItemList'
4142import { fetchInfo } from '../util/network'
4243
4344export interface SelectWalletTokenParams {
@@ -68,7 +69,7 @@ export function selectWalletToken({
6869 // Manually un-pause the wallet, if necessary:
6970 const wallet : EdgeCurrencyWallet = currencyWallets [ walletId ]
7071 if ( wallet . paused && ! isKeysOnlyPlugin ( wallet . currencyInfo . pluginId ) )
71- wallet . changePaused ( false ) . catch ( error => {
72+ wallet . changePaused ( false ) . catch ( ( error : unknown ) => {
7273 showError ( error )
7374 } )
7475
@@ -93,7 +94,7 @@ export function selectWalletToken({
9394 const { isAccountActivationRequired } = getSpecialCurrencyInfo (
9495 wallet . currencyInfo . pluginId
9596 )
96- if ( isAccountActivationRequired ) {
97+ if ( isAccountActivationRequired === true ) {
9798 // activation-required wallets need different path in case not activated yet
9899 if ( alwaysActivate ) {
99100 return await dispatch (
@@ -141,7 +142,7 @@ function selectActivationRequiredWallet(
141142 ) }
142143 buttons = { { ok : { label : lstrings . string_ok } } }
143144 />
144- ) ) . catch ( err => {
145+ ) ) . catch ( ( err : unknown ) => {
145146 showError ( err )
146147 } )
147148 return false
@@ -172,7 +173,7 @@ export function updateMostRecentWalletsSelected(
172173 data : { mostRecentWallets : currentMostRecentWallets }
173174 } )
174175 } )
175- . catch ( error => {
176+ . catch ( ( error : unknown ) => {
176177 showError ( error )
177178 } )
178179 }
@@ -278,7 +279,7 @@ export function activateWalletTokens(
278279 message = { sprintf ( msg , feeString ) }
279280 buttons = { { ok : { label : lstrings . string_ok } } }
280281 />
281- ) ) . catch ( err => {
282+ ) ) . catch ( ( err : unknown ) => {
282283 showError ( err )
283284 } )
284285 navigation . pop ( )
@@ -306,7 +307,7 @@ export function activateWalletTokens(
306307 )
307308 navigation . pop ( )
308309 } )
309- . catch ( e => {
310+ . catch ( ( e : unknown ) => {
310311 navigation . pop ( )
311312 showError ( e )
312313 } )
@@ -413,7 +414,7 @@ export function checkCompromisedKeys(
413414 const keyInfo = exposedKeyInfos . find (
414415 info => info . pubKeyHash === pubkeyHash
415416 )
416- if ( keyInfo ?. exposed ) {
417+ if ( keyInfo ?. exposed === true ) {
417418 exposedWalletIds . push ( walletId )
418419 } else {
419420 securityCheckedWallets [ walletId ] = {
@@ -450,13 +451,17 @@ export function checkCompromisedKeys(
450451 ) )
451452 }
452453
453- // If any walletId come back true show modal to go to migration scene with affected wallets preselected
454- if ( exposedWalletIds . length > 0 ) {
455- const walletNames = exposedWalletIds . map ( walletId =>
454+ const migratableItems = getMigrateWalletItemList ( currencyWallets )
455+ const migratableWalletIds = exposedWalletIds . filter ( id =>
456+ migratableItems . some ( item => item . createWalletId === id )
457+ )
458+
459+ if ( migratableWalletIds . length > 0 ) {
460+ const walletNames = migratableWalletIds . map ( walletId =>
456461 getWalletName ( currencyWallets [ walletId ] )
457462 )
458463 const response = await MigrateWalletsModal ( walletNames )
459- exposedWalletIds . forEach ( walletId => {
464+ migratableWalletIds . forEach ( walletId => {
460465 const { checked, modalShown } = securityCheckedWallets [ walletId ]
461466 securityCheckedWallets [ walletId ] = {
462467 checked,
@@ -466,7 +471,7 @@ export function checkCompromisedKeys(
466471
467472 if ( response === 'yes' ) {
468473 navigation . push ( 'migrateWalletSelectCrypto' , {
469- preSelectedWalletIds : exposedWalletIds
474+ preSelectedWalletIds : migratableWalletIds
470475 } )
471476 }
472477 }
0 commit comments