mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-18 08:34:21 +01:00
don't include url fragment in client url check
This commit is contained in:
@@ -26,13 +26,14 @@ self.addEventListener('notificationclick', function(event) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const findClientForUrl = function(url) {
|
const findClientForUrl = function(urlToOpen) {
|
||||||
return self.clients.matchAll({
|
return self.clients.matchAll({
|
||||||
type: "window",
|
type: "window",
|
||||||
includeUncontrolled: true,
|
includeUncontrolled: true,
|
||||||
}).then(function (clientList) {
|
}).then(function (clientList) {
|
||||||
return clientList.find(function(client) {
|
return clientList.find(function(client) {
|
||||||
return client.url.endsWith(url);
|
const [ clientUrlWithoutFragment ] = client.url.split("#");
|
||||||
|
return clientUrlWithoutFragment.endsWith(urlToOpen);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user