mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
🐛 (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: Jed Fox <git@jedfox.com>
This commit is contained in:
committed by
GitHub
parent
06b2a8757e
commit
4f5fd6c463
@@ -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 →
|
||||
</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>
|
||||
)}
|
||||
|
||||
6
upcoming-release-notes/1128.md
Normal file
6
upcoming-release-notes/1128.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [MatissJanis]
|
||||
---
|
||||
|
||||
Nordigen: fix first-time setup flow when started in the accounts page
|
||||
Reference in New Issue
Block a user