From 1c483f42c07a10e0de3d8dc9f40cd9fe589b84f5 Mon Sep 17 00:00:00 2001 From: Zach Whelchel Date: Thu, 11 Jan 2024 16:15:27 -0500 Subject: [PATCH] Refactored language for consistency. --- .../src/components/modals/CreateAccount.tsx | 4 ++-- packages/loot-core/src/server/accounts/link.ts | 2 +- packages/loot-core/src/server/accounts/sync.ts | 10 +--------- packages/loot-core/src/server/main.ts | 6 +++--- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/desktop-client/src/components/modals/CreateAccount.tsx b/packages/desktop-client/src/components/modals/CreateAccount.tsx index 5ccf875e4c9..cef5940f0b9 100644 --- a/packages/desktop-client/src/components/modals/CreateAccount.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccount.tsx @@ -178,7 +178,7 @@ export function CreateAccount({ Link a European bank account - + {' '} to automatically download transactions. GoCardless provides reliable, up-to-date information from hundreds of banks. @@ -201,7 +201,7 @@ export function CreateAccount({ Link a North American bank account - + {' '} to automatically download transactions. SimpleFIN provides reliable, up-to-date information from hundreds of banks. diff --git a/packages/loot-core/src/server/accounts/link.ts b/packages/loot-core/src/server/accounts/link.ts index 891f03a315a..9e8b85ea078 100644 --- a/packages/loot-core/src/server/accounts/link.ts +++ b/packages/loot-core/src/server/accounts/link.ts @@ -143,7 +143,7 @@ export async function addGoCardlessAccounts( }); // Do an initial sync - await bankSync.syncGoCardlessAccount( + await bankSync.syncExternalAccount( userId, userKey, id, diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts index d6f5f18857f..61a52f940b5 100644 --- a/packages/loot-core/src/server/accounts/sync.ts +++ b/packages/loot-core/src/server/accounts/sync.ts @@ -807,15 +807,7 @@ export async function addTransactions( return newTransactions; } -// TODO: This needs to be renamed to something more generic as it includes SimpleFin now. - -export async function syncGoCardlessAccount( - userId, - userKey, - id, - acctId, - bankId, -) { +export async function syncExternalAccount(userId, userKey, id, acctId, bankId) { // TODO: Handle the case where transactions exist in the future // (that will make start date after end date) const latestTransaction = await db.first( diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts index 662bac1a14c..eaf964bd5a6 100644 --- a/packages/loot-core/src/server/main.ts +++ b/packages/loot-core/src/server/main.ts @@ -688,7 +688,7 @@ handlers['gocardless-accounts-link'] = async function ({ }); } - await bankSync.syncGoCardlessAccount( + await bankSync.syncExternalAccount( undefined, undefined, id, @@ -742,7 +742,7 @@ handlers['simplefin-accounts-link'] = async function ({ }); } - await bankSync.syncGoCardlessAccount( + await bankSync.syncExternalAccount( undefined, undefined, id, @@ -1281,7 +1281,7 @@ handlers['gocardless-accounts-sync'] = async function ({ id }) { const acct = accounts[i]; if (acct.bankId) { try { - const res = await bankSync.syncGoCardlessAccount( + const res = await bankSync.syncExternalAccount( userId, userKey, acct.id,