@@ -467,6 +467,9 @@ const AddressViewer = ({
467467 _config : TAddressViewerConfig ,
468468 _allAddresses : TAddressViewerData ,
469469 ) : void => {
470+ if ( privateKey ) {
471+ setPrivateKey ( undefined ) ;
472+ }
470473 if ( ! _allAddresses ) {
471474 _allAddresses = allAddresses ;
472475 }
@@ -513,6 +516,9 @@ const AddressViewer = ({
513516 return ;
514517 }
515518 setLoadingNetwork ( n ) ;
519+ if ( privateKey ) {
520+ setPrivateKey ( undefined ) ;
521+ }
516522 resetUtxos ( ) ;
517523 const newConfig = {
518524 ...config ,
@@ -543,7 +549,14 @@ const AddressViewer = ({
543549 setLoadingNetwork ( undefined ) ;
544550 handleScroll ( maxIndex ) ;
545551 } ,
546- [ config , handleScroll , resetUtxos , selectedWallet , updateSelectedAddress ] ,
552+ [
553+ config ,
554+ handleScroll ,
555+ privateKey ,
556+ resetUtxos ,
557+ selectedWallet ,
558+ updateSelectedAddress ,
559+ ] ,
547560 ) ;
548561
549562 /**
@@ -654,8 +667,11 @@ const AddressViewer = ({
654667 const filtered = fuzzyRes . map ( ( r ) => r . obj ) ;
655668 const sorted = Object . values ( filtered ) . sort ( ( a , b ) => a . index - b . index ) ;
656669 setFilterAddresses ( sorted ) ;
670+ if ( privateKey ) {
671+ setPrivateKey ( undefined ) ;
672+ }
657673 } ,
658- [ searchableAddresses ] ,
674+ [ privateKey , searchableAddresses ] ,
659675 ) ;
660676
661677 /**
@@ -785,6 +801,7 @@ const AddressViewer = ({
785801 */
786802 const onCheckBalance = useCallback ( async ( ) : Promise < void > => {
787803 setIsCheckingBalances ( true ) ;
804+ setPrivateKey ( undefined ) ;
788805
789806 // Ensure we switch networks if the user opted to do-so.
790807 if ( selectedNetwork !== config . selectedNetwork ) {
@@ -1072,6 +1089,7 @@ const AddressViewer = ({
10721089 isSelected = { isSelected }
10731090 backgroundColor = { backgroundColor }
10741091 onItemRowPress = { ( ) : void => {
1092+ setPrivateKey ( undefined ) ;
10751093 setSelectedAddress ( item ) ;
10761094 } }
10771095 onCheckMarkPress = { ( ) : void => {
0 commit comments