client.supportsNotifications

This commit is contained in:
antelle 2021-04-17 09:51:18 +02:00
parent de0cf0ce67
commit a3128e56a3
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 7 additions and 2 deletions

View File

@ -105,6 +105,8 @@ const BrowserExtensionConnector = {
// TODO: check the process
state.active = true;
state.supportsNotifications = true; // TODO: = !isSafari
this.processPendingSocketData(socket);
},
@ -299,8 +301,11 @@ const BrowserExtensionConnector = {
sendSocketEvent(data) {
for (const socket of this.connectedSockets) {
const state = this.connectedSocketState.get(socket);
if (state?.active) {
this.sendSocketResponse(socket, data);
if (state?.active && state.notifications) {
const client = this.connectedClients.get(state.clientId);
if (client?.supportsNotifications) {
this.sendSocketResponse(socket, data);
}
}
}
},