Skip to content

Commit

Permalink
Start resetting profile data when GameSelectionScreen is created
Browse files Browse the repository at this point in the history
  • Loading branch information
VilppeRiskidev committed Jun 25, 2024
1 parent ca35974 commit 1dafecf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/GameSelectionScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ export default class GameSelectionScreen extends Vue {
await this.$store.dispatch('checkMigrations');
this.runningMigration = false;
await this.$store.dispatch('profile/reset');
this.settings = await ManagerSettings.getSingleton(GameManager.defaultGame);
const globalSettings = this.settings.getContext().global;
this.favourites = globalSettings.favouriteGames || [];
Expand Down
15 changes: 15 additions & 0 deletions src/store/modules/ProfileModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ export default {
},

mutations: {
resetNonGlobalState(state: State) {
state.activeProfile = null;
state.modList = [];
state.order = undefined;
state.direction = undefined;
state.disabledPosition = undefined;
state.searchQuery = '';
state.dismissedUpdateAll = false;
},

dismissUpdateAll(state: State) {
state.dismissedUpdateAll = true;
},
Expand Down Expand Up @@ -292,6 +302,11 @@ export default {
commit('setDisabledPosition', settings.getInstalledDisablePosition());
},

async reset({commit, rootGetters}) {
await rootGetters['settings'].setProfile('Default');
commit('resetNonGlobalState');
},

async resolveConflicts(
{},
params: {
Expand Down

0 comments on commit 1dafecf

Please sign in to comment.