Skip to content

Commit

Permalink
Add a getter isModListOutdated
Browse files Browse the repository at this point in the history
  • Loading branch information
VilppeRiskidev committed Feb 12, 2025
1 parent 9be88b0 commit e8cc77f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/store/modules/TsModsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export const TsModsModule = {
return getters.cachedMod(mod).isLatest;
},

/*** Was the last successful mod list update more than an hour ago? */
isModListOutdated(state) {
return state.modsLastUpdated instanceof Date
&& (Date.now() - state.modsLastUpdated.getTime()) > (1000 * 60 * 60);
},

/*** Return ThunderstoreMod representation of a ManifestV2 */
tsMod: (_state, getters) => (mod: ExportMod|ManifestV2): ThunderstoreMod | undefined => {
return getters.cachedMod(mod).tsMod;
Expand Down

0 comments on commit e8cc77f

Please sign in to comment.