Skip to content

Commit 1dafecf

Browse files
Start resetting profile data when GameSelectionScreen is created
1 parent ca35974 commit 1dafecf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/pages/GameSelectionScreen.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ export default class GameSelectionScreen extends Vue {
326326
await this.$store.dispatch('checkMigrations');
327327
this.runningMigration = false;
328328
329+
await this.$store.dispatch('profile/reset');
329330
this.settings = await ManagerSettings.getSingleton(GameManager.defaultGame);
330331
const globalSettings = this.settings.getContext().global;
331332
this.favourites = globalSettings.favouriteGames || [];

src/store/modules/ProfileModule.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ export default {
119119
},
120120

121121
mutations: {
122+
resetNonGlobalState(state: State) {
123+
state.activeProfile = null;
124+
state.modList = [];
125+
state.order = undefined;
126+
state.direction = undefined;
127+
state.disabledPosition = undefined;
128+
state.searchQuery = '';
129+
state.dismissedUpdateAll = false;
130+
},
131+
122132
dismissUpdateAll(state: State) {
123133
state.dismissedUpdateAll = true;
124134
},
@@ -292,6 +302,11 @@ export default {
292302
commit('setDisabledPosition', settings.getInstalledDisablePosition());
293303
},
294304

305+
async reset({commit, rootGetters}) {
306+
await rootGetters['settings'].setProfile('Default');
307+
commit('resetNonGlobalState');
308+
},
309+
295310
async resolveConflicts(
296311
{},
297312
params: {

0 commit comments

Comments
 (0)