Replace lists by sets in the apply action cache

This commit is contained in:
Jonas Lochmann
2020-09-28 02:00:00 +02:00
parent 8d65c5d777
commit 8ebeadad5a
24 changed files with 55 additions and 46 deletions
@@ -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)
}