mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
pinia: some small adjustments
This commit is contained in:
parent
673cc4e4c0
commit
aed1e7da73
|
@ -110,6 +110,7 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
isWebserverMode: (state) => state.botState?.runmode === RunModes.WEBSERVER,
|
||||
selectedBacktestResult: (state) => state.backtestHistory[state.selectedBacktestResultKey],
|
||||
shortAllowed: (state) => state.botState?.short_allowed || false,
|
||||
openTradeCount: (state) => state.openTrades.length,
|
||||
isTrading: (state) =>
|
||||
state.botState?.runmode === RunModes.LIVE || state.botState?.runmode === RunModes.DRY_RUN,
|
||||
timeframe: (state) => state.botState?.timeframe || '',
|
||||
|
@ -789,6 +790,5 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
return useBotStore();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,11 @@ export const useBotStore = defineStore('wrapper', {
|
|||
},
|
||||
getters: {
|
||||
hasBots: (state) => Object.keys(state.availableBots).length > 0,
|
||||
botCount: (state) => Object.keys(state.availableBots).length,
|
||||
allBotStores: (state) => Object.values(state.botStores),
|
||||
activeBot: (state) =>
|
||||
state.botStores[state.selectedBot] as ReturnType<typeof createBotSubStore>,
|
||||
selectedBotObj: (state) => state.availableBots[state.selectedBot],
|
||||
},
|
||||
actions: {
|
||||
selectBot(botId: string) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user