aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/login/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/login/index.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/login/index.tsx17
1 files changed, 5 insertions, 12 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/login/index.tsx b/packages/merchant-backoffice-ui/src/paths/login/index.tsx
index 9948307e4..a9e3c3a1b 100644
--- a/packages/merchant-backoffice-ui/src/paths/login/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/login/index.tsx
@@ -52,7 +52,7 @@ function cleanUp(s: string): string {
}
export function LoginPage({ onConfirm }: Props): VNode {
- const { url: backendURL, changeBackend } = useBackendContext();
+ const { url: backendURL, changeBackend, resetBackend } = useBackendContext();
const { admin, id } = useInstanceContext();
const { requestNewLoginToken } = useCredentialsChecker();
const [token, setToken] = useState("");
@@ -73,10 +73,9 @@ export function LoginPage({ onConfirm }: Props): VNode {
}, [backendURL, id, token])
async function changeServer() {
- changeBackend("")
+ resetBackend()
}
- console.log(admin, id)
if (admin && id !== "default") {
//admin trying to access another instance
return (<div class="columns is-centered" style={{ margin: "auto" }}>
@@ -211,10 +210,7 @@ export function LoginPage({ onConfirm }: Props): VNode {
borderTop: 0,
}}
>
- <AsyncButton
-
- onClick={changeServer}
- >
+ <AsyncButton onClick={changeServer}>
<i18n.Translate>Change server</i18n.Translate>
</AsyncButton>
@@ -304,11 +300,8 @@ export function ConnectionPage({ onConfirm }: { onConfirm: (s: string) => void }
borderTop: 0,
}}
>
- <AsyncButton
- disabled={backendURL === url}
- onClick={doConnect}
- >
- <i18n.Translate>Try again</i18n.Translate>
+ <AsyncButton onClick={doConnect}>
+ <i18n.Translate>Connect</i18n.Translate>
</AsyncButton>
</footer>
</div>