From 97597c0923c8862efeebd006bc4940ec047438b3 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 23 Feb 2023 16:08:48 +0500 Subject: [PATCH] mobile: disable buttons in loading state --- apps/mobile/app/components/auth/login.js | 2 +- apps/mobile/app/components/auth/signup.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/mobile/app/components/auth/login.js b/apps/mobile/app/components/auth/login.js index 9bcc081cd..eb0d3ceb5 100644 --- a/apps/mobile/app/components/auth/login.js +++ b/apps/mobile/app/components/auth/login.js @@ -26,7 +26,6 @@ import { eSendEvent } from "../../services/event-manager"; import { useThemeStore } from "../../stores/use-theme-store"; import { SIZE } from "../../utils/size"; import { sleep } from "../../utils/time"; -import BaseDialog from "../dialog/base-dialog"; import SheetProvider from "../sheet-provider"; import { Progress } from "../sheets/progress"; import { Button } from "../ui/button"; @@ -131,6 +130,7 @@ export const Login = ({ changeMode }) => { marginTop: 5 }} onPress={() => { + if (loading) return; changeMode(1); }} size={SIZE.md} diff --git a/apps/mobile/app/components/auth/signup.js b/apps/mobile/app/components/auth/signup.js index 161f8fcbf..2eaffd61c 100644 --- a/apps/mobile/app/components/auth/signup.js +++ b/apps/mobile/app/components/auth/signup.js @@ -30,7 +30,6 @@ import { useUserStore } from "../../stores/use-user-store"; import { openLinkInBrowser } from "../../utils/functions"; import { SIZE } from "../../utils/size"; import { sleep } from "../../utils/time"; -import BaseDialog from "../dialog/base-dialog"; import { Button } from "../ui/button"; import Input from "../ui/input"; import { SvgView } from "../ui/svg"; @@ -97,9 +96,6 @@ export const Signup = ({ changeMode, trial }) => { return ( <> - {loading ? ( - - ) : null} { textAlign: "center" }} onPress={() => { + if (loading) return; changeMode(0); }} size={SIZE.md} @@ -235,7 +232,10 @@ export const Signup = ({ changeMode, trial }) => { borderRadius: 100 }} loading={loading} - onPress={signup} + onPress={() => { + if (loading) return; + signup(); + }} type="accent" title={loading ? null : "Agree and continue"} />