mirror of https://github.com/bra1n/townsquare.git
simplify session URLs
This commit is contained in:
parent
41af82cc5c
commit
7c0f31584c
|
@ -253,7 +253,7 @@ export default {
|
|||
.then(({ state }) => {
|
||||
if (state === "granted" || state === "prompt") {
|
||||
const url = window.location.href.split("#")[0];
|
||||
const link = url + "#play/" + this.session.sessionId;
|
||||
const link = url + "#" + this.session.sessionId;
|
||||
navigator.clipboard.writeText(link);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -736,9 +736,9 @@ export default store => {
|
|||
});
|
||||
|
||||
// check for session Id in hash
|
||||
const [command, param] = window.location.hash.substr(1).split("/");
|
||||
if (command === "play") {
|
||||
const sessionId = window.location.hash.substr(1);
|
||||
if (sessionId) {
|
||||
store.commit("session/setSpectator", true);
|
||||
store.commit("session/setSessionId", param);
|
||||
store.commit("session/setSessionId", sessionId);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue