Add watcher so changing to logged in user's team from viewing another teams page works without reload
This commit is contained in:
parent
4fbb1f0284
commit
bd0bafe705
@ -244,6 +244,16 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
seasonNumber(newValue, oldValue) {
|
||||||
|
if (newValue !== oldValue)
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
teamAbbreviation(newName, oldName) {
|
||||||
|
if (newName !== oldName)
|
||||||
|
this.fetchData()
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchData(): Promise<void> {
|
async fetchData(): Promise<void> {
|
||||||
this.team = await fetchTeam(this.seasonNumber, this.teamAbbreviation)
|
this.team = await fetchTeam(this.seasonNumber, this.teamAbbreviation)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user