From 1a2b41407b4f5f87ae0decf6a2764a6f3fa6670d Mon Sep 17 00:00:00 2001 From: Roman Cervantes Date: Tue, 16 Jul 2019 10:39:36 -0700 Subject: [PATCH] Go to setting tab based on where you are in the app --- src/pages/Settings.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 5804ee59..4858b5a6 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -9,7 +9,7 @@ @click="openSettings(section)" > - {{ $t(`settings.${section.name}`) }} + {{ getTabName(section.name) }} @@ -133,10 +133,20 @@ export default { this.localSettings = JSON.parse(JSON.stringify(this.settings)); this.language = this.localSettings.language || 'en'; - this.openSettings(this.settingsSections[0]); + switch (this.$route.name) { + case 'game-board': this.openSettings({ name: 'gameBoard', component: 'GameBoardSettings' }); break; + case 'platforms': this.openSettings({ name: 'platforms', component: 'PlatformsSettings' }); break; + default: this.openSettings(this.settingsSections[0]); + } }, methods: { + getTabName(sectionName) { + return sectionName === 'gameBoard' && this.platform && this.$route.name === 'game-board' + ? this.platform.name + : this.$t(`settings.${sectionName}`); + }, + openSettings({ component, name }) { this.activeComponent = component; this.activeSection = name;