@@ -42,12 +42,16 @@ const getTitle = ({ mode }: { mode: SignerMode }) => {
4242} ;
4343
4444const SignerSelectorButton = ( { mode, onClick } : ButtonProps ) : JSX . Element => {
45- const { walletKit } = useStore ( ) ;
45+ const { walletKit, network } = useStore ( ) ;
4646 const { publicKey : walletKitPubKey } = walletKit || { } ;
4747
4848 const savedLocalKeypairs = localStorageSavedKeypairs . get ( ) ;
4949
50- const hasKeypairs = savedLocalKeypairs . length > 0 ;
50+ const currentNetworkKeypairs = savedLocalKeypairs . filter (
51+ ( keypair ) => keypair . network . id === network . id ,
52+ ) ;
53+
54+ const hasKeypairs = currentNetworkKeypairs . length > 0 ;
5155 const hasWallet = ! ! walletKitPubKey ;
5256
5357 const title = getTitle ( { mode } ) ;
@@ -84,9 +88,13 @@ const SignerSelectorDropdown = ({
8488 onClose,
8589 mode,
8690} : DropdownProps ) : JSX . Element => {
87- const { walletKit } = useStore ( ) ;
91+ const { walletKit, network } = useStore ( ) ;
8892 const { publicKey : walletKitPubKey } = walletKit || { } ;
8993 const savedLocalKeypairs = localStorageSavedKeypairs . get ( ) ;
94+
95+ const currentNetworkKeypairs = savedLocalKeypairs . filter (
96+ ( keypair ) => keypair . network . id === network . id ,
97+ ) ;
9098 const dropdownRef = useRef < HTMLDivElement | null > ( null ) ;
9199
92100 const handleClickOutside = useCallback (
@@ -124,10 +132,10 @@ const SignerSelectorDropdown = ({
124132 availableAddress . push ( saved ) ;
125133 }
126134
127- if ( savedLocalKeypairs ) {
135+ if ( currentNetworkKeypairs . length > 0 ) {
128136 const saved = {
129137 label : "Saved Keypairs" ,
130- items : localStorageSavedKeypairs . get ( ) ,
138+ items : currentNetworkKeypairs ,
131139 } ;
132140 availableAddress . push ( saved ) ;
133141 }
0 commit comments