Skip to content

A local-first personal finance app

:bug: (bank-sync) fix initial sync - close modal stack, show loading indicators (#3540)

Matiss Janis Aboltins47ef91687371
diff --git a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
index c0f2242f94..ea3086e82d 100644
--- a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
+++ b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import {
+ closeModal,
linkAccount,
linkAccountSimpleFin,
unlinkAccount,
@@ -90,6 +91,8 @@ export function SelectLinkedAccountsModal({
}
},
);
+
+ dispatch(closeModal());
}
const unlinkedAccounts = localAccounts.filter(
@@ -176,10 +179,7 @@ export function SelectLinkedAccountsModal({
>
<Button
variant="primary"
- onPress={() => {
- onNext();
- close();
- }}
+ onPress={onNext}
isDisabled={!Object.keys(chosenAccounts).length}
>
Link accounts
diff --git a/packages/loot-core/src/client/actions/account.ts b/packages/loot-core/src/client/actions/account.ts
index df0a9c3785..e10263f6cb 100644
--- a/packages/loot-core/src/client/actions/account.ts
+++ b/packages/loot-core/src/client/actions/account.ts
@@ -55,8 +55,17 @@ export function unlinkAccount(id: string) {
};
}
-export function linkAccount(requisitionId, account, upgradingId, offBudget) {
+export function linkAccount(
+ requisitionId: string,
+ account: unknown,
+ upgradingId?: string,
+ offBudget?: boolean,
+) {
return async (dispatch: Dispatch) => {
+ if (upgradingId) {
+ await dispatch(setAccountsSyncing([upgradingId]));
+ }
+
await send('gocardless-accounts-link', {
requisitionId,
account,
@@ -68,8 +77,16 @@ export function linkAccount(requisitionId, account, upgradingId, offBudget) {
};
}
-export function linkAccountSimpleFin(externalAccount, upgradingId, offBudget) {
+export function linkAccountSimpleFin(
+ externalAccount: unknown,
+ upgradingId?: string,
+ offBudget?: boolean,
+) {
return async (dispatch: Dispatch) => {
+ if (upgradingId) {
+ await dispatch(setAccountsSyncing([upgradingId]));
+ }
+
await send('simplefin-accounts-link', {
externalAccount,
upgradingId,
diff --git a/upcoming-release-notes/3540.md b/upcoming-release-notes/3540.md
new file mode 100644
index 0000000000..5225ba0452
--- /dev/null
+++ b/upcoming-release-notes/3540.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+BankSync: fix showing sync status after linking and close all modal stack.