Skip to content

Commit

Permalink
fix: [lw-11748] show empty pass error on input in change password mod…
Browse files Browse the repository at this point in the history
…al (#1490)
  • Loading branch information
vetalcore authored Oct 30, 2024
1 parent 1057bda commit 55db0e0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/nami/src/ui/app/components/changePasswordModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ export interface ChangePasswordModalComponentRef {
openModal: () => void;
}

interface State {
currentPassword: string;
newPassword: string;
repeatPassword: string;
matchingPassword: boolean;
passwordLen: boolean | null;
show: boolean;
}

const ChangePasswordModalComponent = ({ changePassword }: Props, ref) => {
const capture = useCaptureEvent();
const cancelRef = React.useRef<HTMLButtonElement>(null);
Expand All @@ -41,12 +50,12 @@ const ChangePasswordModalComponent = ({ changePassword }: Props, ref) => {

const { isOpen, onOpen, onClose } = useDisclosure();
const [isLoading, setIsLoading] = React.useState(false);
const [state, setState] = React.useState({
const [state, setState] = React.useState<State>({
currentPassword: '',
newPassword: '',
repeatPassword: '',
matchingPassword: false,
passwordLen: false,
passwordLen: null,
show: false,
});

Expand All @@ -56,7 +65,7 @@ const ChangePasswordModalComponent = ({ changePassword }: Props, ref) => {
newPassword: '',
repeatPassword: '',
matchingPassword: false,
passwordLen: false,
passwordLen: null,
show: false,
});
}, [isOpen]);
Expand Down

0 comments on commit 55db0e0

Please sign in to comment.