diff --git a/src/components/BotList.vue b/src/components/BotList.vue index 29f9c3c4..9452978a 100644 --- a/src/components/BotList.vue +++ b/src/components/BotList.vue @@ -1,15 +1,23 @@ @@ -26,10 +34,14 @@ const ftbot = namespace('ftbot'); @Component({ components: { LoginModal, DeleteIcon, EditIcon } }) export default class BotList extends Vue { + @ftbot.Getter [MultiBotStoreGetters.selectedBot]: string; + @ftbot.Getter [MultiBotStoreGetters.allAvailableBots]: string[]; @ftbot.Action removeBot; + @ftbot.Action selectBot; + clickRemoveBot(botId) { // this.$bvModal.msgBoxConfirm(`Really remove (logout) from ${botId}?`).then((value: boolean) => { diff --git a/src/store/modules/botStoreWrapper.ts b/src/store/modules/botStoreWrapper.ts index 8b2831c9..6fe116b0 100644 --- a/src/store/modules/botStoreWrapper.ts +++ b/src/store/modules/botStoreWrapper.ts @@ -89,6 +89,9 @@ export default function createBotStore(store) { commit('selectBot', getters.allAvailableBots[0]); } }, + selectBot({ commit }, botId: string) { + commit('selectBot', botId); + }, }; // Autocreate Actions Object.keys(BotStoreActions).forEach((e) => {