From bd0bafe7050e2861fc5f61e0cca8297a38d9f85e Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 17 Sep 2023 10:17:57 -0400 Subject: [PATCH] Add watcher so changing to logged in user's team from viewing another teams page works without reload --- src/views/TeamView.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/views/TeamView.vue b/src/views/TeamView.vue index ca29ed4..e94768e 100644 --- a/src/views/TeamView.vue +++ b/src/views/TeamView.vue @@ -244,6 +244,16 @@ export default { created() { this.fetchData() }, + watch: { + seasonNumber(newValue, oldValue) { + if (newValue !== oldValue) + this.fetchData() + }, + teamAbbreviation(newName, oldName) { + if (newName !== oldName) + this.fetchData() + } + }, methods: { async fetchData(): Promise { this.team = await fetchTeam(this.seasonNumber, this.teamAbbreviation)