Skip to content

Commit

Permalink
Change default exclusion list from undefined to empty array
Browse files Browse the repository at this point in the history
After the recent changes that made the exclusion list global instead of
game specific, and changed it to be loaded on app startup, using
undefined as the default is no longer needed and only makes the typing
awkward.
  • Loading branch information
anttimaki committed Jan 7, 2025
1 parent 2b76ee9 commit 1d208af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/store/modules/TsModsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface CachedMod {
interface State {
cache: Map<string, CachedMod>;
deprecated: Map<string, boolean>;
exclusions?: string[];
exclusions: string[];
isThunderstoreModListUpdateInProgress: boolean;
mods: ThunderstoreMod[];
modsLastUpdated?: Date;
Expand Down Expand Up @@ -54,7 +54,7 @@ export const TsModsModule = {
cache: new Map<string, CachedMod>(),
deprecated: new Map<string, boolean>(),
/*** Packages available through API that should be ignored by the manager */
exclusions: undefined,
exclusions: [],
/*** Mod list is updated from the API automatically and by user action */
isThunderstoreModListUpdateInProgress: false,
/*** All mods available through API for the current active game */
Expand Down Expand Up @@ -334,7 +334,7 @@ export const TsModsModule = {
{chunks, indexHash}: {chunks: PackageListChunks, indexHash: string}
) {
const filtered = chunks.map((chunk) => chunk.filter(
(pkg) => !state.exclusions!.includes(pkg.full_name)
(pkg) => !state.exclusions.includes(pkg.full_name)
));
const community = rootState.activeGame.internalFolderName;
await PackageDb.updateFromApiResponse(community, filtered);
Expand Down

0 comments on commit 1d208af

Please sign in to comment.