commit ae993d949b4a754bf87f1eb008ec8e6803170ebb parent a37abf4713955fbe89bd7c371a89a1f47729e2fe Author: Sebastian <sebasjm@gmail.com> Date: Thu, 27 Jun 2024 09:14:35 -0300 fix routing when a non-default instance didn't have bank account Diffstat:
| M | packages/merchant-backoffice-ui/src/Routing.tsx | | | 26 | +++++++++++++++++++------- |
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/Routing.tsx b/packages/merchant-backoffice-ui/src/Routing.tsx @@ -165,7 +165,7 @@ export function Routing(_p: Props): VNode { accounts !== undefined && accounts.accounts.length < 1 && (AbsoluteTime.isNever(preference.hideMissingAccountUntil) || - AbsoluteTime.cmp(now, preference.hideMissingAccountUntil) > 1); + AbsoluteTime.cmp(now, preference.hideMissingAccountUntil) > 0); const shouldLogin = state.status === "loggedOut"; @@ -182,12 +182,24 @@ export function Routing(_p: Props): VNode { return ( <Fragment> <Menu /> - <BankAccountBanner /> - <BankAccountCreatePage - onConfirm={() => { - route(InstancePaths.bank_list); - }} - /> + <Router history={history}> + <Route path={InstancePaths.interface} component={Settings} /> + <Route + default + component={() => { + return ( + <Fragment> + <BankAccountBanner /> + <BankAccountCreatePage + onConfirm={() => { + route(InstancePaths.bank_list); + }} + /> + </Fragment> + ); + }} + /> + </Router> </Fragment> ); }