Skip to content

Commit

Permalink
player menu in lower third refreshes
Browse files Browse the repository at this point in the history
all components now wait for state to load before first-time mount
resolve #45
  • Loading branch information
ebshimizu committed Apr 17, 2021
1 parent 3cc9bce commit f72e0f5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
</v-btn>
</template>
</v-banner>
<router-view></router-view>
<router-view v-if="stateReady"></router-view>
</v-container>
</v-main>

Expand Down Expand Up @@ -316,6 +316,8 @@ export default {
this.$i18n.locale = state.app.locale
}
this.stateReady = true
this.loadStatus = 'Mounting Components'
setTimeout(() => {
this.loadStatus = 'Load Complete'
this.appReady = true
Expand All @@ -333,6 +335,7 @@ export default {
updateAvailable: false,
showUpdateStatus: false,
updateVersion: undefined,
stateReady: false,
}
},
methods: {
Expand Down
16 changes: 15 additions & 1 deletion src/renderer/components/LowerThird.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<v-col cols="2" v-show="erbsPlayerStat">
<v-combobox
label="Player Name"
:items="$store.getters.playerPoolItems"
:items="playerSelect"
:value="erbsPlayer.playerName"
@input="(v) => updateErbsPlayer('playerName', v)"
@change="(v) => checkForExistingPlayer(v)"
Expand Down Expand Up @@ -160,14 +160,28 @@ export default {
status: '',
error: false,
apiLoading: false,
playerSelect: [],
}
},
watch: {
players(val) {
this.playerSelect = val.map((p) => p.name)
},
},
beforeMount() {
this.playerSelect = Object.values(this.$store.state.show.playerPool).map(
(p) => p.name,
)
},
computed: {
seasons() {
return Object.entries(SEASONS).map(([text, value]) => {
return { text, value }
})
},
players() {
return Object.values(this.$store.state.show.playerPool)
},
squadSizes() {
return Object.entries(SQUAD_SIZES).map(([text, value]) => {
return { text, value }
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/data/gameConfig/erbs/characters.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,11 @@
"name": "Barbara",
"classname": "Barbara",
"ltImgSrc": "/img/erbs/sm-portrait/26-Barbara.png"
},
"27": {
"code": 27,
"name": "Alex",
"classname": "Alex",
"ltImgSrc": "/img/erbs/sm-portrait/27-Alex.png"
}
}

0 comments on commit f72e0f5

Please sign in to comment.