From 7cd1a6417d8f3f2f05a968aee85bd405258b4dd6 Mon Sep 17 00:00:00 2001 From: cardosofede Date: Mon, 25 Sep 2023 16:38:45 -0300 Subject: [PATCH] (feat) add error handling if not controller selected --- ui_components/launch_strategy_v2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui_components/launch_strategy_v2.py b/ui_components/launch_strategy_v2.py index d7dd999..4a68121 100644 --- a/ui_components/launch_strategy_v2.py +++ b/ui_components/launch_strategy_v2.py @@ -48,7 +48,7 @@ class LaunchStrategyV2(Dashboard.Item): self._controller_config_selected = params def launch_new_bot(self): - if self._bot_name and self._image_name: + if self._bot_name and self._image_name and len(self._controller_config_selected) > 0: bot_name = f"hummingbot-{self._bot_name}" extra_environment_variables = ["-e", "CONFIG_FILE_NAME=strategy_v2_launcher.py", "-e", f"controller_configs={','.join(self._controller_config_selected)}"] @@ -63,7 +63,8 @@ class LaunchStrategyV2(Dashboard.Item): with st.spinner('Starting Master Configs instance... This process may take a few seconds'): time.sleep(3) else: - st.warning("You need to define the bot name and image in order to create one.") + st.warning("You need to define the bot name and select the controllers configs " + "that you want to deploy.") def __call__(self): with mui.Paper(key=self._key,