Skip to content

A local-first personal finance app

:bug: (nordigen) linking an account via account page (#1128)

Matiss Janis Aboltins4f5fd6c463a0
diff --git a/packages/desktop-client/src/components/modals/NordigenExternalMsg.js b/packages/desktop-client/src/components/modals/NordigenExternalMsg.js
index 5c052b1947..975a3b2bdb 100644
--- a/packages/desktop-client/src/components/modals/NordigenExternalMsg.js
+++ b/packages/desktop-client/src/components/modals/NordigenExternalMsg.js
@@ -1,5 +1,7 @@
import React, { useEffect, useState, useRef } from 'react';
+import { useDispatch } from 'react-redux';
+import { pushModal } from 'loot-core/src/client/actions/modals';
import { sendCatch } from 'loot-core/src/platform/client/fetch';
import useNordigenStatus from '../../hooks/useNordigenStatus';
@@ -67,11 +69,14 @@ export default function NordigenExternalMsg({
onSuccess,
onClose: originalOnClose,
}) {
+ const dispatch = useDispatch();
+
let [waiting, setWaiting] = useState(null);
let [success, setSuccess] = useState(false);
let [institutionId, setInstitutionId] = useState();
let [country, setCountry] = useState();
let [error, setError] = useState(null);
+ let [isNordigenSetupComplete, setIsNordigenSetupComplete] = useState(null);
let data = useRef(null);
const {
@@ -109,6 +114,14 @@ export default function NordigenExternalMsg({
setWaiting(null);
}
+ const onNordigenInit = () => {
+ dispatch(
+ pushModal('nordigen-init', {
+ onSuccess: () => setIsNordigenSetupComplete(true),
+ }),
+ );
+ };
+
const renderLinkButton = () => {
return (
<View style={{ gap: 10 }}>
@@ -246,20 +259,17 @@ export default function NordigenExternalMsg({
>
Success! Click to continue &rarr;
</Button>
- ) : isConfigured ? (
+ ) : isConfigured || isNordigenSetupComplete ? (
renderLinkButton()
) : (
- <P style={{ color: colors.r5 }}>
- Nordigen integration has not been configured so linking accounts
- is not available.{' '}
- <a
- href="https://actualbudget.github.io/docs/Accounts/connecting-your-bank/"
- target="_blank"
- rel="noopener noreferrer"
- >
- Learn more.
- </a>
- </P>
+ <>
+ <P style={{ color: colors.r5 }}>
+ Nordigen integration has not yet been configured.
+ </P>
+ <Button primary onClick={onNordigenInit}>
+ Configure Nordigen integration
+ </Button>
+ </>
)}
</View>
)}
diff --git a/upcoming-release-notes/1128.md b/upcoming-release-notes/1128.md
new file mode 100644
index 0000000000..f5617ccd6f
--- /dev/null
+++ b/upcoming-release-notes/1128.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Nordigen: fix first-time setup flow when started in the accounts page