From 233c28e1b35d6c75ca1ace350337a4d4eb971ca5 Mon Sep 17 00:00:00 2001 From: Gamebrary Date: Sat, 26 Sep 2020 20:44:05 -0700 Subject: [PATCH] set latest release as selected release by default --- src/pages/Releases.vue | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/pages/Releases.vue b/src/pages/Releases.vue index cb835669..defa554b 100644 --- a/src/pages/Releases.vue +++ b/src/pages/Releases.vue @@ -80,22 +80,18 @@ export default { this.selectedRelease = latestRelease; - if (this.notification) { - const [latestRelease] = this.releases; + if (this.notification && latestRelease && latestRelease.tag_name) { + this.$store.commit('UPDATE_SETTING', { key: 'release', value: latestRelease.tag_name }); - if (latestRelease && latestRelease.tag_name) { - this.$store.commit('UPDATE_SETTING', { key: 'release', value: latestRelease.tag_name }); - - this.$store.dispatch('SAVE_SETTINGS', this.settings) - .then(() => { - this.$store.commit('SET_NOTIFICATION', false); - }) - .catch(() => { - this.$bvToast.toast( - 'There was an error saving your settings', - { title: 'Error', variant: 'danger' }); - }); - } + this.$store.dispatch('SAVE_SETTINGS', this.settings) + .then(() => { + this.$store.commit('SET_NOTIFICATION', false); + }) + .catch(() => { + this.$bvToast.toast( + 'There was an error saving your settings', + { title: 'Error', variant: 'danger' }); + }); } },