Try focus first, then postMessage

pull/268/head
Lim Chee Aun 2023-10-19 17:45:27 +08:00
rodzic e9075906f8
commit c9545cdc34
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -179,12 +179,12 @@ self.addEventListener('notificationclick', (event) => {
console.log('NOTIFICATION CLICK navigate', url);
if (bestClient) {
console.log('NOTIFICATION CLICK postMessage', bestClient);
bestClient.focus();
bestClient.postMessage?.({
type: 'notification',
id: tag,
accessToken: access_token,
});
bestClient.focus();
} else {
console.log('NOTIFICATION CLICK openWindow', url);
await self.clients.openWindow(url);