fixin bugs

Co-authored-by: Lianne Turnbull <lianne.turnbull@gmail.com>
This commit is contained in:
Dave Garnar 2024-02-23 14:02:47 +00:00
parent 626827bfea
commit d34905d09b
3 changed files with 19 additions and 2 deletions

View file

@ -265,9 +265,15 @@ export default {
} }
}, },
copySessionUrl() { copySessionUrl() {
const url = window.location.href.split("#")[0]; try{
const url = window.location.href.split("#")[0];
const link = url + "#" + this.session.sessionId; const link = url + "#" + this.session.sessionId;
navigator.clipboard.writeText(link); navigator.clipboard.writeText(link);
}
catch (error)
{
}
}, },
distributeRoles() { distributeRoles() {
if (this.session.isSpectator) return; if (this.session.isSpectator) return;
@ -295,7 +301,9 @@ export default {
let sessionId = prompt( let sessionId = prompt(
"Enter the channel number / name of the session you want to join" "Enter the channel number / name of the session you want to join"
); );
if (sessionId.match(/^https?:\/\//i)) { if (sessionId)
{
if (sessionId.match(/^https?:\/\//i)) {
sessionId = sessionId.split("#").pop(); sessionId = sessionId.split("#").pop();
} }
if (sessionId) { if (sessionId) {
@ -304,6 +312,8 @@ export default {
this.$store.commit("toggleGrimoire", false); this.$store.commit("toggleGrimoire", false);
this.$store.commit("session/setSessionId", sessionId); this.$store.commit("session/setSessionId", sessionId);
} }
}
}, },
leaveSession() { leaveSession() {
if (confirm("Are you sure you want to leave the active live game?")) { if (confirm("Are you sure you want to leave the active live game?")) {

View file

@ -136,6 +136,7 @@ export default {
}); });
} }
this.tab = "editionRoles"; this.tab = "editionRoles";
this.filter = "";
this.$store.commit("toggleModal", "role"); this.$store.commit("toggleModal", "role");
}, },
close() { close() {

View file

@ -267,6 +267,12 @@ export const store = Vuex.createStore({
) )
.map((role) => [role.id, role]) .map((role) => [role.id, role])
); );
state.otherRoles = rolesJSON.filter(
(r) =>
r.team !== "traveler" &&
r.team !== "fabled" &&
!roles.some((i) => i.id === r.id)
);
}, },
setEdition(state, edition) { setEdition(state, edition) {
if (editionJSONbyId.has(edition.id)) { if (editionJSONbyId.has(edition.id)) {