Deleting Fabled while changing script

This commit is contained in:
MRegnard 2023-11-19 14:48:01 +01:00 committed by GitHub
parent 1096bb0a3c
commit 442aaff539
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@
)})`, )})`,
}" }"
:key="edition.id" :key="edition.id"
@click="setEdition(edition)" @click="runEdition(edition)"
> >
{{ edition.name }} {{ edition.name }}
</li> </li>
@ -191,16 +191,19 @@ export default {
"setEdition", "setEdition",
Object.assign({}, meta, { id: "custom" }), Object.assign({}, meta, { id: "custom" }),
); );
// check for fabled and set those too, if present // set fabled
if (roles.some((role) => this.$store.state.fabled.has(role.id || role))) { const fabled = [];
const fabled = []; roles.forEach((role) => {
roles.forEach((role) => { if (this.$store.state.fabled.has(role.id || role)) {
if (this.$store.state.fabled.has(role.id || role)) { fabled.push(this.$store.state.fabled.get(role.id || role));
fabled.push(this.$store.state.fabled.get(role.id || role)); }
} });
}); this.$store.commit("players/setFabled", { fabled });
this.$store.commit("players/setFabled", { fabled }); },
} runEdition(edition) {
this.$store.commit("setEdition", edition);
// The editions contain no Fabled
this.$store.commit("players/setFabled", { fabled: [] });
}, },
...mapMutations(["toggleModal", "setEdition"]), ...mapMutations(["toggleModal", "setEdition"]),
}, },