Skip to content
Snippets Groups Projects
Unverified Commit 4f5fd6c4 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

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

Fix linking via the account page. Previously it was not fully working if
the user had not set up the credentials before.



https://github.com/actualbudget/actual/assets/886567/588dc437-b53d-4616-8612-a2ef07445dc8



---------

Co-authored-by: default avatarJed Fox <git@jedfox.com>
parent 06b2a875
No related branches found
No related tags found
No related merge requests found
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>
)}
......
---
category: Bugfix
authors: [MatissJanis]
---
Nordigen: fix first-time setup flow when started in the accounts page
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment