From 8897f14effe309276c08961206ebc1a38ddf8f5d Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Mon, 6 Jun 2022 16:49:24 +0800 Subject: [PATCH] chore: add Reset loading remind (#829) --- packages/kit/src/views/Me/SecuritySection/ResetButton.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/kit/src/views/Me/SecuritySection/ResetButton.tsx b/packages/kit/src/views/Me/SecuritySection/ResetButton.tsx index 56e5c662a84..8ccf5150b3f 100644 --- a/packages/kit/src/views/Me/SecuritySection/ResetButton.tsx +++ b/packages/kit/src/views/Me/SecuritySection/ResetButton.tsx @@ -28,6 +28,7 @@ const ResetDialog: FC = ({ onConfirm, onClose }) => { const intl = useIntl(); const [input, setInput] = useState(''); + const [loading, setLoading] = useState(false); return ( = ({ onConfirm, onClose }) => { primaryActionProps: { type: 'destructive', isDisabled: input.toUpperCase() !== 'RESET', + isLoading: loading, }, onPrimaryActionPress: async () => { - await onConfirm?.(); + setLoading(true); + await onConfirm(); + setLoading(false); onClose?.(); }, onSecondaryActionPress: () => {