0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 03:02:40 +00:00

Shift GC to use savedAt time

This commit is contained in:
G.Ambatte
2024-09-14 23:43:44 +12:00
parent 7ec2558eef
commit ff19e3875e

View File

@@ -126,7 +126,7 @@ export function versionHistoryGarbageCollection(){
return key.startsWith(HISTORY_PREFIX);
})
.forEach((key)=>{
const collectAt = new Date(JSON.parse(localStorage.getItem(key)).expireAt);
const collectAt = new Date(JSON.parse(localStorage.getItem(key)).savedAt);
collectAt.setMinutes(collectAt.getMinutes() + GARBAGE_COLLECT_DELAY);
if(new Date() > collectAt){
localStorage.removeItem(key);