Skip to content

Commit

Permalink
chore: add Reset loading remind (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZhang1024 authored Jun 6, 2022
1 parent 4d80d44 commit 8897f14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/kit/src/views/Me/SecuritySection/ResetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ResetDialog: FC<ResetDialogProps> = ({ onConfirm, onClose }) => {
const intl = useIntl();

const [input, setInput] = useState('');
const [loading, setLoading] = useState(false);

return (
<Dialog
Expand All @@ -38,9 +39,12 @@ const ResetDialog: FC<ResetDialogProps> = ({ onConfirm, onClose }) => {
primaryActionProps: {
type: 'destructive',
isDisabled: input.toUpperCase() !== 'RESET',
isLoading: loading,
},
onPrimaryActionPress: async () => {
await onConfirm?.();
setLoading(true);
await onConfirm();
setLoading(false);
onClose?.();
},
onSecondaryActionPress: () => {
Expand Down

0 comments on commit 8897f14

Please sign in to comment.