fix(plugin-projects): CB-2677 ensure that validation state is fresh

This commit is contained in:
naumov
2022-09-30 13:46:19 +03:00
parent 84ca33f63a
commit 4e8664763c
@@ -34,7 +34,7 @@ interface IFolderDialogState {
message: string | undefined;
valid: boolean;
payload: FolderDialogPayload;
validate: () => void;
validate: () => Promise<void>;
setMessage: (message: string) => void;
setProjectId: (projectId: string) => void;
}
@@ -119,7 +119,8 @@ export const FolderDialog: DialogComponent<FolderDialogPayload, IFolderDialogRes
payload,
});
function resolveHandler() {
async function resolveHandler() {
await state.validate();
if (state.valid) {
resolveDialog({ folder: state.value, projectId: state.projectId });
}