Merge pull request #108 from davotronic5000/#94_parse_link_when_joining

#94 parse link when joining
This commit is contained in:
Steffen 2021-01-30 18:00:51 +01:00 committed by GitHub
commit 43070ae1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -255,9 +255,12 @@ 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?:\/\//i)) {
sessionId = sessionId.split("#").pop();
}
if (sessionId) {
this.$store.commit("session/clearVoteHistory");
this.$store.commit("session/setSpectator", true);