We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdb6432 commit bd5f587Copy full SHA for bd5f587
example/web/twilio-sw.js
@@ -110,12 +110,12 @@ function focusClientWindow() {
110
self.clients.matchAll({
111
type: "window",
112
}).then((clients) => {
113
- for (const client of clients) {
114
- if (client.url === "/" && "focus" in client) return client.focus();
115
- }
116
- if (clients.openWindow) return clients.openWindow("/");
117
- }).catch((error) => {
118
- _error('Could not focus client window', error);
+ clients
+ .filter(value => !value.focused)
+ .filter(value => "focus" in value)
+ .forEach((client) => {
+ client.focus().catch((error) => _error('Error focusing client window', error));
+ });
119
});
120
}
121
0 commit comments