diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 30115b6..e50f432 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -265,9 +265,15 @@ export default { } }, copySessionUrl() { - const url = window.location.href.split("#")[0]; + try{ + const url = window.location.href.split("#")[0]; const link = url + "#" + this.session.sessionId; navigator.clipboard.writeText(link); + } + catch (error) + { + } + }, distributeRoles() { if (this.session.isSpectator) return; @@ -295,7 +301,9 @@ export default { let sessionId = prompt( "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(); } if (sessionId) { @@ -304,6 +312,8 @@ export default { this.$store.commit("toggleGrimoire", false); this.$store.commit("session/setSessionId", sessionId); } + } + }, leaveSession() { if (confirm("Are you sure you want to leave the active live game?")) { diff --git a/src/components/modals/RoleModal.vue b/src/components/modals/RoleModal.vue index 1ea8309..3489f8f 100644 --- a/src/components/modals/RoleModal.vue +++ b/src/components/modals/RoleModal.vue @@ -136,6 +136,7 @@ export default { }); } this.tab = "editionRoles"; + this.filter = ""; this.$store.commit("toggleModal", "role"); }, close() { diff --git a/src/store/index.js b/src/store/index.js index 36eb2ef..e90c934 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -267,6 +267,12 @@ export const store = Vuex.createStore({ ) .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) { if (editionJSONbyId.has(edition.id)) {