Skip to content

Commit

Permalink
fix: update selectable accounts (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss authored Sep 26, 2024
1 parent 65b2f8d commit 6c5ca2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ const useAccountImportScreen = ({ wallet }: { wallet: Wallet }): UseAccountImpor

const loadAccountsByKeyring = async (keyring: Keyring): Promise<void> => {
setIsLoadingAccounts(true);
const filteredAccounts = loadedAccounts.filter((account) => account.keyringId === keyring.id);
await waitForRun(async () => {
const startIndex = loadedAccounts.length;
const startIndex = filteredAccounts.length;
const range = Array.from({ length: 5 }, (_, index) => index + startIndex);

const accounts: Account[] = [];
Expand All @@ -255,8 +256,9 @@ const useAccountImportScreen = ({ wallet }: { wallet: Wallet }): UseAccountImpor

return accounts;
}).then((accounts) => {
const currentAccounts = [...filteredAccounts, ...accounts];
setIsLoadingAccounts(false);
setLoadedAccounts([...loadedAccounts, ...accounts]);
setLoadedAccounts(currentAccounts);
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const SelectAccountStep = ({
} = useAccountImportScreenReturn;

const { data: accountInfos = [] } = useQuery<AccountInfo[]>(
['accountImportSelectAccounts', loadedAccounts.length],
['accountImportSelectAccounts', loadedAccounts],
async () => {
const accountInfos: AccountInfo[] = [];
for (const account of loadedAccounts) {
Expand Down

0 comments on commit 6c5ca2f

Please sign in to comment.