diff --git a/components/views/navigation/slimbar/Slimbar.html b/components/views/navigation/slimbar/Slimbar.html
index 2469c972c3..bc75c06253 100644
--- a/components/views/navigation/slimbar/Slimbar.html
+++ b/components/views/navigation/slimbar/Slimbar.html
@@ -75,7 +75,7 @@
diff --git a/components/views/settings/Sidebar.vue b/components/views/settings/Sidebar.vue
index 348b79f670..744be4ae25 100644
--- a/components/views/settings/Sidebar.vue
+++ b/components/views/settings/Sidebar.vue
@@ -32,7 +32,7 @@ export default Vue.extend({
},
data() {
return {
- route: 'personalize',
+ route: this.$store.state.ui.settingsDefaultRoute,
sidebarLayout: [
{
title: 'General',
diff --git a/components/views/settings/modal/Modal.vue b/components/views/settings/modal/Modal.vue
index 9581d0b042..75dfc26802 100644
--- a/components/views/settings/modal/Modal.vue
+++ b/components/views/settings/modal/Modal.vue
@@ -18,13 +18,13 @@ export default Vue.extend({
},
data() {
return {
- page: 'personalize',
+ page: this.$store.state.ui.settingsDefaultRoute,
settingSwiperOption: {
initialSlide: 0,
resistanceRatio: 0,
slidesPerView: 'auto',
noSwiping: !this.$device.isMobile,
- allowTouchMove: !!this.$device.isMobile,
+ allowTouchMove: this.$device.isMobile,
},
}
},
@@ -76,7 +76,7 @@ export default Vue.extend({
* @example
*/
closeModal() {
- this.$store.commit('ui/toggleSettings', false)
+ this.$store.commit('ui/toggleSettings', { show: false })
},
},
})
diff --git a/store/ui/__snapshots__/state.test.ts.snap b/store/ui/__snapshots__/state.test.ts.snap
index f3706fbe14..8deaa6e027 100644
--- a/store/ui/__snapshots__/state.test.ts.snap
+++ b/store/ui/__snapshots__/state.test.ts.snap
@@ -73,6 +73,7 @@ Object {
"messageID": null,
"status": false,
},
+ "settingsDefaultRoute": "personalize",
"settingsSideBar": true,
"showPinned": false,
"showSearchResult": false,
diff --git a/store/ui/actions.ts b/store/ui/actions.ts
index 48c7c88151..e034cc1699 100644
--- a/store/ui/actions.ts
+++ b/store/ui/actions.ts
@@ -36,7 +36,7 @@ export default {
* @example Mousetrap.bind('ctrl+s', dispatch('audio/toggleMute') )
*/
openSettings({ commit, state }: any) {
- commit('toggleSettings', !state.showSettings)
+ commit('toggleSettings', { show: !state.showSettings })
},
/**
* @method activateKeybinds
diff --git a/store/ui/mutations.ts b/store/ui/mutations.ts
index d88dfea35a..017a883903 100644
--- a/store/ui/mutations.ts
+++ b/store/ui/mutations.ts
@@ -63,8 +63,14 @@ export default {
route: options.route || 'emotes',
}
},
- toggleSettings(state: UIState, show: boolean) {
+ toggleSettings(
+ state: UIState,
+ options: { show: boolean; defaultRoute?: string },
+ ) {
+ const { show, defaultRoute } = options
+
state.showSettings = show
+ state.settingsDefaultRoute = defaultRoute || 'personalize'
},
toggleSettingsSidebar(state: UIState, show: boolean) {
state.settingsSideBar = show
diff --git a/store/ui/state.ts b/store/ui/state.ts
index 2bba6099e7..0ce6850220 100644
--- a/store/ui/state.ts
+++ b/store/ui/state.ts
@@ -7,6 +7,7 @@ const InitialUIState = (): UIState => ({
showSearchResult: false,
showSettings: false,
settingsSideBar: true,
+ settingsDefaultRoute: 'personalize',
quickProfile: false,
userProfile: {},
contextMenuValues: [],
diff --git a/store/ui/types.ts b/store/ui/types.ts
index edf7734157..00c4012b7a 100644
--- a/store/ui/types.ts
+++ b/store/ui/types.ts
@@ -132,6 +132,7 @@ export interface UIState {
quickProfilePosition: object
showSettings: boolean
settingsSideBar: boolean
+ settingsDefaultRoute: string
showSidebarUsers: boolean
showSearchResult: boolean
showSidebar: boolean