mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-09 11:55:37 +01:00
don't use url to open room as it still refreshes the page on chrome
even though only the hash is different
This commit is contained in:
parent
3767060632
commit
8894329fa3
@ -76,6 +76,8 @@ export class ServiceWorkerHandler {
|
|||||||
// this flag is read in fetch.js
|
// this flag is read in fetch.js
|
||||||
this.haltRequests = true;
|
this.haltRequests = true;
|
||||||
event.source.postMessage({replyTo: data.id});
|
event.source.postMessage({replyTo: data.id});
|
||||||
|
} else if (data.type === "openRoom") {
|
||||||
|
this._navigation.push("room", data.payload.roomId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,9 +201,8 @@ async function openClientFromNotif(event) {
|
|||||||
});
|
});
|
||||||
if (clientWithSession) {
|
if (clientWithSession) {
|
||||||
console.log("notificationclick: client has session open, showing room there");
|
console.log("notificationclick: client has session open, showing room there");
|
||||||
// just change the hash, so the page doesn't refresh on / vs /index.html
|
// use a message rather than clientWithSession.navigate here as this refreshes the page on chrome
|
||||||
const roomURL = new URL(roomHash, clientWithSession.url).href;
|
clientWithSession.postMessage({type: "openRoom", payload: {roomId}});
|
||||||
clientWithSession.navigate(roomURL);
|
|
||||||
if ('focus' in clientWithSession) {
|
if ('focus' in clientWithSession) {
|
||||||
try {
|
try {
|
||||||
await clientWithSession.focus();
|
await clientWithSession.focus();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user