Skip to content

Commit

Permalink
fix: Batch Restore is not selected (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZhang1024 authored Oct 11, 2022
1 parent e18a0c5 commit 49becc8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/kit/src/views/Account/AddNewAccount/RecoverConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@ const RecoverConfirmDone: FC<RecoverConfirmDoneProps> = ({
let unAddedIndexes: number[] = [];

if (isBatchMode) {
const addedMap = new Map<number, boolean>();
const ignoreAccount = new Set<number>();
restoreAccounts?.forEach((i) => {
// existent account
if (i.isDisabled && i.selected) {
addedMap.set(i.index, true);
ignoreAccount.add(i.index);
}
// unselected account
if (!i.selected) {
ignoreAccount.add(i.index);
}
});

unAddedIndexes = Array.from(Array(config.generateCount ?? 1).keys())
.map((index) => {
const i = index + config.fromIndex - 1;
if (addedMap.has(i)) {
if (ignoreAccount.has(i)) {
return undefined;
}
return i;
Expand Down

0 comments on commit 49becc8

Please sign in to comment.