Skip to content

Commit

Permalink
Fix an issue with exclusion list not getting updated when needed
Browse files Browse the repository at this point in the history
When updating the persistent cache, a sanity check ensured the
exclusion list loaded before trying to use it. However, as an empty
array was used as the default value (and the value used when the store
was reset), the sanity check never triggered.

It's unlikely this has caused issues before, as the exclusion list
should've always been updated before updating the persistent cache.
This however changed when Splash screen was changed to skip unnecessary
steps to get the user to profile selection screen faster.
  • Loading branch information
anttimaki committed Nov 14, 2024
1 parent 11574f2 commit dc93a3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/store/modules/TsModsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const TsModsModule = {
connectionError: '',
deprecated: new Map<string, boolean>(),
/*** Packages available through API that should be ignored by the manager */
exclusions: [],
exclusions: undefined,
/*** Mod list is automatically and periodically updated in the background */
isBackgroundUpdateInProgress: false,
/*** All mods available through API for the current active game */
Expand Down Expand Up @@ -121,7 +121,7 @@ export const TsModsModule = {
state.cache = new Map<string, CachedMod>();
state.connectionError = '';
state.deprecated = new Map<string, boolean>();
state.exclusions = [];
state.exclusions = undefined;
state.mods = [];
state.modsLastUpdated = undefined;
},
Expand Down Expand Up @@ -248,6 +248,8 @@ export const TsModsModule = {
{dispatch, rootState, state},
{chunks, indexHash}: {chunks: PackageListChunks, indexHash: string}
) {
// Splash screen skipped this if there was no need to update the
// package list. It may be needed later by e.g. the background update.
if (state.exclusions === undefined) {
await dispatch('updateExclusions');
}
Expand Down

0 comments on commit dc93a3d

Please sign in to comment.