From 40fcf179d701ad27b6afb83d6cfbc5e6ee4ea44f Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 10 Dec 2020 15:19:33 -0700 Subject: [PATCH] Add getters for the team names. --- web/src/store/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/store/index.js b/web/src/store/index.js index aa2264c..08961a5 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -36,6 +36,20 @@ export default new Vuex.Store({ id: null, players: [], }, + getters: { + teamName(state) { + if (state.team > 0) { + return state[`team_${state.team}`].name; + }; + return ``; + }, + otherTeamName(state) { + if (state.team > 0) { + return state[`team_${3 - state.team}`].name; + }; + return ``; + } + }, mutations: { }, actions: {