simplify session URLs

This commit is contained in:
Steffen 2020-12-14 21:49:40 +01:00
parent 41af82cc5c
commit 7c0f31584c
2 changed files with 5 additions and 5 deletions

View File

@ -253,7 +253,7 @@ export default {
.then(({ state }) => { .then(({ state }) => {
if (state === "granted" || state === "prompt") { if (state === "granted" || state === "prompt") {
const url = window.location.href.split("#")[0]; const url = window.location.href.split("#")[0];
const link = url + "#play/" + this.session.sessionId; const link = url + "#" + this.session.sessionId;
navigator.clipboard.writeText(link); navigator.clipboard.writeText(link);
} }
}); });

View File

@ -736,9 +736,9 @@ export default store => {
}); });
// check for session Id in hash // check for session Id in hash
const [command, param] = window.location.hash.substr(1).split("/"); const sessionId = window.location.hash.substr(1);
if (command === "play") { if (sessionId) {
store.commit("session/setSpectator", true); store.commit("session/setSpectator", true);
store.commit("session/setSessionId", param); store.commit("session/setSessionId", sessionId);
} }
}; };