Skip to content

Commit c683679

Browse files
committed
fix: match all clients in the CLIENT_CLOSED closure only
1 parent eb0e58f commit c683679

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/mockServiceWorker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ addEventListener('message', async function (event) {
2727
return
2828
}
2929

30-
const allClients = await self.clients.matchAll({
31-
type: 'window',
32-
})
33-
3430
if (event.data === 'CLIENT_CLOSED') {
31+
const allClients = await self.clients.matchAll({
32+
type: 'window',
33+
})
34+
3535
activeClientIds.delete(clientId)
3636

3737
const remainingClients = allClients.filter((client) => {

0 commit comments

Comments
 (0)