diff --git a/src/store/modules/TsModsModule.ts b/src/store/modules/TsModsModule.ts index 5a98518d0..002cc01e5 100644 --- a/src/store/modules/TsModsModule.ts +++ b/src/store/modules/TsModsModule.ts @@ -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;