From 8e6a2d8e7dbdc072e5f77c0ea0c5b88834230982 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 26 Oct 2021 15:23:07 +0300 Subject: [PATCH] UI: bugfix the need to double click on the import when importing an encrypted configuration When back-end sends the schema for ui to validate that no unsafe options are selected, UI didn't automatically send a response back in case there were no unsafe options selected --- .../components/configuration-components/ImportConfigModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx b/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx index 9456e7dd8..8a600ab28 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx @@ -37,7 +37,7 @@ const ConfigImportModal = (props: Props) => { if (configContents !== null) { sendConfigToServer(); } - }, [configContents]) + }, [configContents, unsafeOptionsVerified]) function sendConfigToServer() { @@ -67,6 +67,7 @@ const ConfigImportModal = (props: Props) => { } else if (res['import_status'] === 'unsafe_options_verification_required') { setUploadStatus(UploadStatuses.success); setErrorMessage(''); + if (isUnsafeOptionSelected(res['config_schema'], JSON.parse(res['config']))) { setShowUnsafeOptionsConfirmation(true); setCandidateConfig(res['config']);