Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Dec 19, 2024
1 parent ccaf3d7 commit 9f560a7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/loot-core/src/client/accounts/accountSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const linkAccountSimpleFin = createAppAsyncThunk(
);

function handleSyncResponse(
accountId: string,
accountId: AccountEntity['id'],
res: {
errors: Array<{
type: string;
Expand Down Expand Up @@ -199,19 +199,20 @@ export const syncAccounts = createAppAsyncThunk(
'accounts/syncAccounts',
async ({ id }: SyncAccountsArgs, thunkApi) => {
// Disallow two parallel sync operations
if (thunkApi.getState().account.accountsSyncing.length > 0) {
const accountState = thunkApi.getState().account;
if (accountState.accountsSyncing.length > 0) {
return false;
}

const batchSync = !id;

// Build an array of IDs for accounts to sync.. if no `id` provided
// then we assume that all accounts should be synced
const queriesState = thunkApi.getState().queries;
let accountIdsToSync = !batchSync
? [id]
: thunkApi
.getState()
.queries.accounts.filter(
: queriesState.accounts
.filter(
({ bank, closed, tombstone }) => !!bank && !closed && !tombstone,
)
.sort((a, b) =>
Expand Down

0 comments on commit 9f560a7

Please sign in to comment.