From f725efd41aa21e598c271968990c54d71ed4fc33 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 14 Jul 2021 16:30:41 +0200 Subject: [PATCH] ui: Refactor scoutsuite hiding functions --- .../components/pages/RunMonkeyPage/RunOptions.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js index 5fe6444d7..f38c48990 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js @@ -58,20 +58,18 @@ function RunOptions(props) { } function getIslandMode() { - let mode = ''; + let mode = 'advanced'; authComponent.authFetch(MODE_URL) .then(res => res.json()) .then(res => { mode = res.mode } ); + return mode; + } - if (mode === 'ransomware') { - return false; - } - else { - return true; - } + function shouldShowScoutsuite(){ + return getIslandMode() === 'advanced'; } function defaultContents() { @@ -87,8 +85,8 @@ function RunOptions(props) { setComponent(LocalManualRunOptions, {ips: ips, setComponent: setComponent}) }}/> - {getIslandMode() && } - {getIslandMode() && } + {shouldShowScoutsuite() && {