From cc26bab72e1f681bcc46331fdeb379281eacb577 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 14 May 2021 15:36:09 +0200 Subject: [PATCH] Show an appropriate message when a user can not sign into his account --- src/ui/routes/LoginRoute.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ui/routes/LoginRoute.tsx b/src/ui/routes/LoginRoute.tsx index dad72b0..9848aa3 100644 --- a/src/ui/routes/LoginRoute.tsx +++ b/src/ui/routes/LoginRoute.tsx @@ -28,7 +28,7 @@ import { } from "../../helpers/AccountHelper"; import { input, matAlert } from "../widgets/DialogsProvider"; -function ErrorGettingOptions() { +function ErrorGettingOptions(p: { message: string }) { return ( -   Could not get your auth options! +   {p.message} ); } @@ -180,7 +180,7 @@ export class LoginRoute extends React.Component<{}, LoginRouteState> { {/* Login error (if any) */} {this.state.errorGettingAuthOptions ? ( - ErrorGettingOptions() + ) : (
)} @@ -265,6 +265,15 @@ class AuthOptionsWidget extends React.Component< } render() { + // Check if no option is available + if ( + this.props.options.keys.length == 0 && + !this.props.options.reset_token + ) + return ( + + ); + return (