Fix htag in localstorage

Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
Gregoire Parant 2021-11-24 19:24:43 +01:00
parent 445599416c
commit 060c844468
5 changed files with 36 additions and 8 deletions

View file

@ -40,7 +40,8 @@ class UrlManager {
public pushRoomIdToUrl(room: Room): void {
if (window.location.pathname === room.id) return;
//Set last room visited! (connected or nor, must to be saved in localstorage and cache API)
localUserStore.setLastRoomUrl(room.key);
//use href to keep # value
localUserStore.setLastRoomUrl(room.href);
const hash = window.location.hash;
const search = room.search.toString();
history.pushState({}, "WorkAdventure", room.id + (search ? "?" + search : "") + hash);