From 6acd9061a3d0348651d064e651a642f703ba89c1 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 14 Jul 2021 14:27:17 -0400 Subject: [PATCH] Island: Set correct default config tab on refresh --- .../cc/ui/src/components/pages/ConfigurePage.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index 4f1df6bab..c7c84e327 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -50,6 +50,13 @@ class ConfigurePageComponent extends AuthComponent { }; } + componentDidUpdate() { + if (!this.getSectionsOrder().includes(this.currentSection)) { + this.currentSection = this.getSectionsOrder()[0] + this.setState({selectedSection: this.currentSection}) + } + } + getSectionsOrder() { let islandMode = this.props.islandMode ? this.props.islandMode : 'advanced' return CONFIGURATION_TABS_PER_MODE[islandMode];