Merge pull request #120 from MRegnard:fabled_set_script

Deleting Fabled while we set script
This commit is contained in:
Pingumask 2023-11-20 23:26:48 +01:00 committed by GitHub
commit 64a3c92df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View file

@ -1,6 +1,7 @@
# Release Notes # Release Notes
## Upcomming Version ## Upcomming Version
Correcting automatic adding/deletion of Fabled
### Version 3.17.0 ### Version 3.17.0

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"]),
}, },