Skip to content

Commit 7a6adce

Browse files
committed
reset mounting error upon input change
1 parent 5cc7b1f commit 7a6adce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plugins/drivelistmanager.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface IDriveInputProps {
2929
isPublic: boolean;
3030
setIsPublic: (value: boolean) => void;
3131
mountError: string;
32+
resetMountError: () => void;
3233
}
3334

3435
export function DriveInputComponent({
@@ -39,7 +40,8 @@ export function DriveInputComponent({
3940
onSubmit,
4041
isPublic,
4142
setIsPublic,
42-
mountError
43+
mountError,
44+
resetMountError
4345
}: IDriveInputProps) {
4446
return (
4547
<div>
@@ -48,6 +50,7 @@ export function DriveInputComponent({
4850
className="drive-search-input"
4951
onInput={(event: any) => {
5052
setPublicDrive(event.target.value);
53+
resetMountError();
5154
}}
5255
placeholder="Enter drive name"
5356
value={driveValue}
@@ -72,6 +75,7 @@ export function DriveInputComponent({
7275
className="drive-region-input"
7376
onInput={(event: any) => {
7477
setRegion(event.target.value);
78+
resetMountError();
7579
}}
7680
placeholder="Region (e.g.: us-east-1)"
7781
value={regionValue}
@@ -259,6 +263,7 @@ export function DriveListManagerComponent({ model }: IProps) {
259263
setIsPublic={setIsPublic}
260264
onSubmit={onAddedPublicDrive}
261265
mountError={mountError}
266+
resetMountError={() => setMountError('')}
262267
/>
263268
</div>
264269

0 commit comments

Comments
 (0)