Disable load_from_strateegy button when bot is offline or in webserver mode

This commit is contained in:
Matthias 2022-12-13 06:30:38 +01:00
parent 89de68f334
commit 0c0399579e

View File

@ -65,7 +65,13 @@
<div>
<b-button class="ms-1" variant="secondary" size="sm" @click="loadPlotConfig">Load</b-button>
<b-button class="ms-1" variant="secondary" size="sm" @click="loadPlotConfigFromStrategy">
<b-button
:disabled="botStore.activeBot.isWebserverMode || !botStore.activeBot.isBotOnline"
class="ms-1"
variant="secondary"
size="sm"
@click="loadPlotConfigFromStrategy"
>
From strategy
</b-button>
@ -135,6 +141,7 @@ defineProps({
});
const plotStore = usePlotConfigStore();
const botStore = useBotStore();
const plotConfig = ref<PlotConfig>(EMPTY_PLOTCONFIG);
@ -284,7 +291,6 @@ const resetConfig = () => {
};
const loadPlotConfigFromStrategy = async () => {
try {
const botStore = useBotStore();
await botStore.activeBot.getStrategyPlotConfig();
if (botStore.activeBot.strategyPlotConfig) {
plotConfig.value = botStore.activeBot.strategyPlotConfig;