mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Replace lists by sets in the apply action cache
This commit is contained in:
@@ -48,5 +48,5 @@ export async function dispatchAddInstalledApps ({ deviceId, action, cache }: {
|
||||
{ transaction: cache.transaction }
|
||||
)
|
||||
|
||||
cache.devicesWithModifiedInstalledApps.push(deviceId)
|
||||
cache.devicesWithModifiedInstalledApps.add(deviceId)
|
||||
}
|
||||
|
||||
@@ -110,10 +110,10 @@ export async function dispatchAddUsedTime ({ action, cache }: {
|
||||
transaction: cache.transaction
|
||||
})
|
||||
|
||||
cache.categoriesWithModifiedBaseData.push(categoryId)
|
||||
cache.categoriesWithModifiedBaseData.add(categoryId)
|
||||
}
|
||||
|
||||
cache.categoriesWithModifiedUsedTimes.push(categoryId)
|
||||
cache.categoriesWithModifiedUsedTimes.add(categoryId)
|
||||
}
|
||||
|
||||
await handleAddUsedTime({
|
||||
|
||||
@@ -202,7 +202,7 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||
}
|
||||
}
|
||||
|
||||
cache.categoriesWithModifiedUsedTimes.push(item.categoryId)
|
||||
cache.categoriesWithModifiedUsedTimes.add(item.categoryId)
|
||||
|
||||
if (item.extraTimeToSubtract !== 0) {
|
||||
await cache.database.category.update({
|
||||
@@ -215,7 +215,7 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||
transaction: cache.transaction
|
||||
})
|
||||
|
||||
cache.categoriesWithModifiedBaseData.push(item.categoryId)
|
||||
cache.categoriesWithModifiedBaseData.add(item.categoryId)
|
||||
}
|
||||
|
||||
if (addUsedTimeForADifferentUserThanTheCurrentUserOfTheDevice) {
|
||||
|
||||
@@ -35,5 +35,5 @@ export async function dispatchRemoveInstalledApps ({ deviceId, action, cache }:
|
||||
transaction: cache.transaction
|
||||
})
|
||||
|
||||
cache.devicesWithModifiedInstalledApps.push(deviceId)
|
||||
cache.devicesWithModifiedInstalledApps.add(deviceId)
|
||||
}
|
||||
|
||||
@@ -77,5 +77,5 @@ export async function dispatchUpdateAppActivities ({ deviceId, action, cache }:
|
||||
}
|
||||
}
|
||||
|
||||
cache.devicesWithModifiedInstalledApps.push(deviceId)
|
||||
cache.devicesWithModifiedInstalledApps.add(deviceId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user