mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 09:15:33 +03:00
Try focus first, then postMessage
This commit is contained in:
parent
e9075906f8
commit
c9545cdc34
1 changed files with 1 additions and 1 deletions
|
@ -179,12 +179,12 @@ self.addEventListener('notificationclick', (event) => {
|
||||||
console.log('NOTIFICATION CLICK navigate', url);
|
console.log('NOTIFICATION CLICK navigate', url);
|
||||||
if (bestClient) {
|
if (bestClient) {
|
||||||
console.log('NOTIFICATION CLICK postMessage', bestClient);
|
console.log('NOTIFICATION CLICK postMessage', bestClient);
|
||||||
|
bestClient.focus();
|
||||||
bestClient.postMessage?.({
|
bestClient.postMessage?.({
|
||||||
type: 'notification',
|
type: 'notification',
|
||||||
id: tag,
|
id: tag,
|
||||||
accessToken: access_token,
|
accessToken: access_token,
|
||||||
});
|
});
|
||||||
bestClient.focus();
|
|
||||||
} else {
|
} else {
|
||||||
console.log('NOTIFICATION CLICK openWindow', url);
|
console.log('NOTIFICATION CLICK openWindow', url);
|
||||||
await self.clients.openWindow(url);
|
await self.clients.openWindow(url);
|
||||||
|
|
Loading…
Reference in a new issue