mirror of https://github.com/bra1n/townsquare.git
adding a regex in to the join session method in Menu.vue, to check if a townsquare domain has been entered in to join dialog, if it finds one it will get the session id from the # query string instead of just taking the value directly from the dialog.
This commit is contained in:
parent
7c3908f1fa
commit
fafbb3c23f
|
@ -255,9 +255,16 @@ export default {
|
|||
},
|
||||
joinSession() {
|
||||
if (this.session.sessionId) return this.leaveSession();
|
||||
const sessionId = prompt(
|
||||
let sessionId = prompt(
|
||||
"Enter the channel number / name of the session you want to join"
|
||||
);
|
||||
if (
|
||||
sessionId.match(
|
||||
/^https?:\/\/([^.]+\.github\.io|localhost|clocktower\.online|eddbra1nprivatetownsquare\.xyz)/i
|
||||
)
|
||||
) {
|
||||
sessionId = sessionId.split("#")[1];
|
||||
}
|
||||
if (sessionId) {
|
||||
this.$store.commit("session/clearVoteHistory");
|
||||
this.$store.commit("session/setSpectator", true);
|
||||
|
|
Loading…
Reference in New Issue