From 2358c7d8fb52732b69682948b5c1d738c4d5884f Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Sat, 4 Mar 2023 12:27:27 +0100 Subject: [PATCH] Saving settings and reloading the page to select the invitation account --- src/components/invitation/Invitation.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/invitation/Invitation.tsx b/src/components/invitation/Invitation.tsx index add370c..7b3e1bc 100644 --- a/src/components/invitation/Invitation.tsx +++ b/src/components/invitation/Invitation.tsx @@ -90,6 +90,11 @@ const Invitation: Component = (props) => { mail: user.mail, }; dispatch({ action: 'putAccount', params: { id, account } }); + const settings: any = await dispatch({ action: 'getSettings' }); + dispatch({ + action: 'putSettings', + params: { settings: { ...settings, currentAccountId: id } }, + }); } catch (error) { setInvitation({ ...invitation(), @@ -106,8 +111,9 @@ const Invitation: Component = (props) => { setInvitation({ ...invitation(), failure: undefined, existing: undefined }); }; - const handleCloseAll = () => { + const handleCloseSuccess = () => { setInvitation(false); + location.reload(); }; return ( @@ -146,7 +152,7 @@ const Invitation: Component = (props) => { - @@ -174,7 +180,7 @@ const Invitation: Component = (props) => { {' '}