townsquare/src/store/index.js

265 lines
7.3 KiB
JavaScript
Raw Normal View History

2020-05-02 19:11:20 +00:00
import Vue from "vue";
import Vuex from "vuex";
2020-05-02 19:46:51 +00:00
import persistence from "./persistence";
2020-05-30 20:47:42 +00:00
import socket from "./socket";
2020-05-02 20:23:05 +00:00
import players from "./modules/players";
2020-05-30 20:47:42 +00:00
import session from "./modules/session";
2020-05-02 19:11:20 +00:00
import editionJSON from "../editions.json";
import rolesJSON from "../roles.json";
2020-07-23 11:52:53 +00:00
import fabledJSON from "../fabled.json";
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
import jinxesJSON from "../hatred.json";
2020-05-02 19:11:20 +00:00
Vue.use(Vuex);
2021-02-01 21:33:59 +00:00
// helper functions
const getRolesByEdition = (edition = editionJSON[0]) => {
2020-05-02 19:11:20 +00:00
return new Map(
rolesJSON
.filter(r => r.edition === edition.id || edition.roles.includes(r.id))
2020-05-02 19:11:20 +00:00
.sort((a, b) => b.team.localeCompare(a.team))
.map(role => [role.id, role])
);
};
const getTravelersNotInEdition = (edition = editionJSON[0]) => {
return new Map(
rolesJSON
.filter(
r =>
r.team === "traveler" &&
r.edition !== edition.id &&
!edition.roles.includes(r.id)
)
.map(role => [role.id, role])
);
};
2021-02-01 21:33:59 +00:00
const set = key => ({ grimoire }, val) => {
grimoire[key] = val;
};
const toggle = key => ({ grimoire }, val) => {
if (val === true || val === false) {
grimoire[key] = val;
} else {
grimoire[key] = !grimoire[key];
}
};
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
const clean = id => id.toLocaleLowerCase().replace(/[^a-z0-9]/g, "");
// global data maps
const editionJSONbyId = new Map(
editionJSON.map(edition => [edition.id, edition])
);
const rolesJSONbyId = new Map(rolesJSON.map(role => [role.id, role]));
const fabled = new Map(fabledJSON.map(role => [role.id, role]));
// jinxes
let jinxes = {};
try {
// Note: can't fetch live list due to lack of CORS headers
// fetch("https://bloodontheclocktower.com/script/data/hatred.json")
// .then(res => res.json())
// .then(jinxesJSON => {
jinxes = new Map(
jinxesJSON.map(({ id, hatred }) => [
clean(id),
new Map(hatred.map(({ id, reason }) => [clean(id), reason]))
])
);
// });
} catch (e) {
console.error("couldn't load jinxes", e);
}
// base definition for custom roles
const customRole = {
id: "",
name: "",
image: "",
ability: "",
edition: "custom",
firstNight: 0,
firstNightReminder: "",
otherNight: 0,
otherNightReminder: "",
reminders: [],
remindersGlobal: [],
setup: false,
team: "townsfolk",
isCustom: true
};
2020-05-02 19:11:20 +00:00
export default new Vuex.Store({
2020-05-02 20:23:05 +00:00
modules: {
2020-05-30 20:47:42 +00:00
players,
session
2020-05-02 20:23:05 +00:00
},
2020-05-02 19:11:20 +00:00
state: {
grimoire: {
2020-12-02 19:39:12 +00:00
isNight: false,
2020-05-02 19:11:20 +00:00
isNightOrder: true,
isPublic: true,
2020-05-02 19:33:44 +00:00
isMenuOpen: false,
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
isStatic: false,
isMuted: false,
2021-02-01 21:33:59 +00:00
isImageOptIn: false,
zoom: 0,
background: ""
2020-05-12 17:59:48 +00:00
},
2020-05-02 19:11:20 +00:00
modals: {
edition: false,
2020-08-09 19:28:38 +00:00
fabled: false,
gameState: false,
2020-08-09 19:28:38 +00:00
nightOrder: false,
reference: false,
reminder: false,
2020-08-09 19:28:38 +00:00
role: false,
2020-12-06 21:27:52 +00:00
roles: false,
voteHistory: false
2020-05-02 19:11:20 +00:00
},
edition: editionJSONbyId.get("tb"),
2020-07-23 11:52:53 +00:00
roles: getRolesByEdition(),
otherTravelers: getTravelersNotInEdition(),
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
fabled,
jinxes
2020-05-02 19:11:20 +00:00
},
getters: {
/**
2021-02-03 21:12:38 +00:00
* Return all custom roles, with default values and non-essential data stripped.
* Role object keys will be replaced with a numerical index to conserve bandwidth.
* @param roles
* @returns {[]}
*/
2021-02-03 21:12:38 +00:00
customRolesStripped: ({ roles }) => {
const customRoles = [];
const customKeys = Object.keys(customRole);
const strippedProps = [
"firstNightReminder",
"otherNightReminder",
"isCustom"
];
roles.forEach(role => {
if (!role.isCustom) {
customRoles.push({ id: role.id });
} else {
const strippedRole = {};
for (let prop in role) {
2021-02-03 21:12:38 +00:00
if (strippedProps.includes(prop)) {
continue;
}
2021-02-03 21:12:38 +00:00
const value = role[prop];
if (customKeys.includes(prop) && value !== customRole[prop]) {
strippedRole[customKeys.indexOf(prop)] = value;
}
}
customRoles.push(strippedRole);
}
});
return customRoles;
},
rolesJSONbyId: () => rolesJSONbyId
},
2020-05-02 19:11:20 +00:00
mutations: {
2021-02-01 21:33:59 +00:00
setZoom: set("zoom"),
setBackground: set("background"),
toggleMuted: toggle("isMuted"),
toggleMenu: toggle("isMenuOpen"),
toggleNightOrder: toggle("isNightOrder"),
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
toggleStatic: toggle("isStatic"),
2021-02-01 21:33:59 +00:00
toggleNight: toggle("isNight"),
toggleGrimoire: toggle("isPublic"),
toggleImageOptIn: toggle("isImageOptIn"),
2020-05-02 19:11:20 +00:00
toggleModal({ modals }, name) {
2020-06-04 19:56:07 +00:00
if (name) {
modals[name] = !modals[name];
}
for (let modal in modals) {
if (modal === name) continue;
modals[modal] = false;
2020-05-27 19:42:09 +00:00
}
2020-05-02 19:11:20 +00:00
},
/**
* Store custom roles
* @param state
* @param roles Array of role IDs or full role definitions
*/
setCustomRoles(state, roles) {
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
const processedRoles = roles
// replace numerical role object keys with matching key names
.map(role => {
if (role[0]) {
const customKeys = Object.keys(customRole);
const mappedRole = {};
for (let prop in role) {
if (customKeys[prop]) {
mappedRole[customKeys[prop]] = role[prop];
}
}
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
return mappedRole;
} else {
return role;
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
}
})
// clean up role.id
.map(role => {
role.id = clean(role.id);
return role;
})
// map existing roles to base definition or pre-populate custom roles to ensure all properties
.map(
role =>
rolesJSONbyId.get(role.id) ||
state.roles.get(role.id) ||
Object.assign({}, customRole, role)
)
// default empty icons and placeholders
.map(role => {
if (rolesJSONbyId.get(role.id)) return role;
role.imageAlt = // map team to generic icon
{
townsfolk: "good",
outsider: "outsider",
minion: "minion",
demon: "evil",
fabled: "fabled"
}[role.team] || "custom";
return role;
})
// filter out roles that don't match an existing role and also don't have name/ability/team
.filter(role => role.name && role.ability && role.team)
// sort by team
.sort((a, b) => b.team.localeCompare(a.team));
// convert to Map without Fabled
state.roles = new Map(
processedRoles
.filter(role => role.team !== "fabled")
.map(role => [role.id, role])
);
v2.13.0 (#168) * add support for custom fabled (closes #110) * 2.13.0 * show custom fabled first * add recordVoteHistory & clearVoteHistory to session menu * Update CHANGELOG.md * socket part of toggle recordVoteHistory analogous to isNight * remove accidental * Add files via upload * add custom fabled * Add option to reduce night animations to save power. * add fallback icon for fabled * changelog * disable all animations now * linter * add 'on the block' indicator - after vote, ST chooses to put onto block / empty block / no change to block - player menu has add / remove from block - players are automatically removed from the block when (i) they die (ii) another player is put onto block - fixed crash on add/remove/etc player mid vote * hide rounded corners on maximized modals (barely visible anyway) * ST always sees vote history i.e. toggle affects only players * empty block at night * avoid clashing with seat icon * nlc: toggle within session.js * lint * minor * Use proper "Exile" terminology for exile * Add info about "Banishment"->"Exile" to CHANGELOG * requested changes * remove direct ST control of block * player menu order * move block/night logic from socket to menu * minor fix to previous * on block -> marked * requested changes * requested change Co-authored-by: Steffen <steffen@baumgart.biz> * fix players being moved or removed during a nomination (closes #164) add vue linter * let's try adding a lint error * linter adjusted * it's working! * requested change record marked player id in session * feedback implemented npm audit * prepare develop branch * adjust linter config * revert version bump * fixes & visuals * Update CHANGELOG.md * restore old lint command (fixes #170) * minor fix default * show jinxed interactions on character reference modal * 2.13.0 * changelog Co-authored-by: nicfreeman1209 <nicfreeman1209@gmail.com> Co-authored-by: nicfreeman1209 <14160941+nicfreeman1209@users.noreply.github.com> Co-authored-by: Adrian Irving-Beer <wisq@wisq.net> Co-authored-by: Andrew Conant <emptierset@gmail.com>
2021-05-15 18:07:54 +00:00
// update Fabled to include custom Fabled from this script
state.fabled = new Map([
...processedRoles.filter(r => r.team === "fabled").map(r => [r.id, r]),
...fabledJSON.map(role => [role.id, role])
]);
2021-01-25 15:53:35 +00:00
// update extraTravelers map to only show travelers not in this script
state.otherTravelers = new Map(
rolesJSON
.filter(r => r.team === "traveler" && !roles.some(i => i.id === r.id))
.map(role => [role.id, role])
);
},
2020-05-02 19:11:20 +00:00
setEdition(state, edition) {
if (editionJSONbyId.has(edition.id)) {
state.edition = editionJSONbyId.get(edition.id);
state.roles = getRolesByEdition(state.edition);
state.otherTravelers = getTravelersNotInEdition(state.edition);
} else {
state.edition = edition;
}
state.modals.edition = false;
2020-05-02 19:11:20 +00:00
}
2020-05-02 19:46:51 +00:00
},
2020-05-30 20:47:42 +00:00
plugins: [persistence, socket]
2020-05-02 19:11:20 +00:00
});