mirror of https://github.com/bra1n/townsquare.git
fix sessionId handling for URLs
This commit is contained in:
parent
6d8409d0f0
commit
3545b3a69d
|
@ -241,13 +241,7 @@ export default {
|
|||
if (sessionId) {
|
||||
this.$store.commit("session/clearVoteHistory");
|
||||
this.$store.commit("session/setSpectator", false);
|
||||
this.$store.commit(
|
||||
"session/setSessionId",
|
||||
sessionId
|
||||
.toLocaleLowerCase()
|
||||
.replace(/[^0-9a-z]/g, "")
|
||||
.substr(0, 10)
|
||||
);
|
||||
this.$store.commit("session/setSessionId", sessionId);
|
||||
this.copySessionUrl();
|
||||
}
|
||||
},
|
||||
|
@ -286,13 +280,7 @@ export default {
|
|||
this.$store.commit("session/clearVoteHistory");
|
||||
this.$store.commit("session/setSpectator", true);
|
||||
this.$store.commit("toggleGrimoire", false);
|
||||
this.$store.commit(
|
||||
"session/setSessionId",
|
||||
sessionId
|
||||
.toLocaleLowerCase()
|
||||
.replace(/[^0-9a-z]/g, "")
|
||||
.substr(0, 10)
|
||||
);
|
||||
this.$store.commit("session/setSessionId", sessionId);
|
||||
}
|
||||
},
|
||||
leaveSession() {
|
||||
|
|
|
@ -38,7 +38,6 @@ const getters = {};
|
|||
const actions = {};
|
||||
|
||||
const mutations = {
|
||||
setSessionId: set("sessionId"),
|
||||
setPlayerId: set("playerId"),
|
||||
setSpectator: set("isSpectator"),
|
||||
setReconnecting: set("isReconnecting"),
|
||||
|
@ -48,6 +47,12 @@ const mutations = {
|
|||
setVoteInProgress: set("isVoteInProgress"),
|
||||
claimSeat: set("claimedSeat"),
|
||||
distributeRoles: set("isRolesDistributed"),
|
||||
setSessionId(state, sessionId) {
|
||||
state.sessionId = sessionId
|
||||
.toLocaleLowerCase()
|
||||
.replace(/[^0-9a-z]/g, "")
|
||||
.substr(0, 10);
|
||||
},
|
||||
nomination(
|
||||
state,
|
||||
{ nomination, votes, votingSpeed, lockedVote, isVoteInProgress } = {}
|
||||
|
|
Loading…
Reference in New Issue