diff --git a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx index 8f62089c913..e0d9196e8c8 100644 --- a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx @@ -1,7 +1,7 @@ -// @ts-strict-ignore -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch } from 'react-redux'; +import { DialogTrigger } from 'react-aria-components'; import { pushModal } from 'loot-core/client/actions'; import { send } from 'loot-core/src/platform/client/fetch'; @@ -30,13 +30,12 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { const { t } = useTranslation(); const syncServerStatus = useSyncServerStatus(); const dispatch = useDispatch(); - const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] = - useState(null); - const [isSimpleFinSetupComplete, setIsSimpleFinSetupComplete] = - useState(null); - const [menuGoCardlessOpen, setGoCardlessMenuOpen] = useState(false); - const triggerRef = useRef(null); - const [menuSimplefinOpen, setSimplefinMenuOpen] = useState(false); + const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] = useState< + boolean | null + >(null); + const [isSimpleFinSetupComplete, setIsSimpleFinSetupComplete] = useState< + boolean | null + >(null); const onConnectGoCardless = () => { if (!isGoCardlessSetupComplete) { @@ -139,7 +138,6 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { value: null, }).then(() => { setIsGoCardlessSetupComplete(false); - setGoCardlessMenuOpen(false); }); }); }; @@ -154,7 +152,6 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { value: null, }).then(() => { setIsSimpleFinSetupComplete(false); - setSimplefinMenuOpen(false); }); }); }; @@ -248,13 +245,8 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { : t('Set up GoCardless for bank sync')} {isGoCardlessSetupComplete && ( - <> - - setGoCardlessMenuOpen(false)} - > + { if (item === 'reconfigure') { @@ -281,7 +269,7 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { ]} /> - + )} @@ -317,24 +305,15 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { : t('Set up SimpleFIN for bank sync')} {isSimpleFinSetupComplete && ( - <> - - setSimplefinMenuOpen(false)} - > + { if (item === 'reconfigure') { @@ -349,7 +328,7 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { ]} /> - + )} diff --git a/packages/loot-core/src/types/server-handlers.d.ts b/packages/loot-core/src/types/server-handlers.d.ts index 4afbc72a3e8..657244b3cc5 100644 --- a/packages/loot-core/src/types/server-handlers.d.ts +++ b/packages/loot-core/src/types/server-handlers.d.ts @@ -178,7 +178,7 @@ export interface ServerHandlers { 'account-move': (arg: { id; targetId }) => Promise; - 'secret-set': (arg: { name: string; value: string }) => Promise; + 'secret-set': (arg: { name: string; value: string | null }) => Promise; 'secret-check': (arg: string) => Promise; 'gocardless-poll-web-token': (arg: { diff --git a/upcoming-release-notes/3942.md b/upcoming-release-notes/3942.md new file mode 100644 index 00000000000..c66d2b9326b --- /dev/null +++ b/upcoming-release-notes/3942.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix misaligned gocardless credential popover.