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> <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="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 From strategy
</b-button> </b-button>
@ -135,6 +141,7 @@ defineProps({
}); });
const plotStore = usePlotConfigStore(); const plotStore = usePlotConfigStore();
const botStore = useBotStore();
const plotConfig = ref<PlotConfig>(EMPTY_PLOTCONFIG); const plotConfig = ref<PlotConfig>(EMPTY_PLOTCONFIG);
@ -284,7 +291,6 @@ const resetConfig = () => {
}; };
const loadPlotConfigFromStrategy = async () => { const loadPlotConfigFromStrategy = async () => {
try { try {
const botStore = useBotStore();
await botStore.activeBot.getStrategyPlotConfig(); await botStore.activeBot.getStrategyPlotConfig();
if (botStore.activeBot.strategyPlotConfig) { if (botStore.activeBot.strategyPlotConfig) {
plotConfig.value = botStore.activeBot.strategyPlotConfig; plotConfig.value = botStore.activeBot.strategyPlotConfig;