Skip to content

Commit 612ba53

Browse files
gkalpakthePunderWoman
authored andcommitted
fixup! fix(service-worker): ensure obsolete caches are always cleaned up
1 parent d525746 commit 612ba53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/service-worker/worker/src/app-version.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ export class AppVersion implements UpdateSource {
287287
* Return a list of the names of all caches used by this version.
288288
*/
289289
async getCacheNames(): Promise<string[]> {
290-
const [assetGroupCacheNames, dataGroupCacheNames] = await Promise.all([
291-
Promise.all(this.assetGroups.map(group => group.getCacheNames())),
292-
Promise.all(this.dataGroups.map(group => group.getCacheNames())),
290+
const allGroupCacheNames = await Promise.all([
291+
...this.assetGroups.map(group => group.getCacheNames()),
292+
...this.dataGroups.map(group => group.getCacheNames()),
293293
]);
294-
return ([] as string[]).concat(...assetGroupCacheNames, ...dataGroupCacheNames);
294+
return ([] as string[]).concat(...allGroupCacheNames);
295295
}
296296

297297
/**

0 commit comments

Comments
 (0)