Skip to content

Commit

Permalink
Merge pull request #794 from Muttley/develop
Browse files Browse the repository at this point in the history
Release 2.2.1
  • Loading branch information
Muttley authored May 13, 2024
2 parents 9c7d103 + 9160a37 commit 42c4a7e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v2.2.1

## Bugfixes
* [#793] Spell Book won't open on Foundry thick client: Object.groupBy is not a function

---

# v2.2.0

## Enhancements
Expand Down
15 changes: 11 additions & 4 deletions system/src/apps/SpellBookSD.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ export default class SpellBookSD extends FormApplication {
// load all spells for class based on source filter
const spells = await shadowdark.compendiums.classSpellBook(this.classID);

// group spells by tier
this.data.spellList = Object.groupBy(
Array.from(spells.values()), ({system}) => system.tier
);
const spellList = {};
for (const spell of spells) {
const tier = spell.system.tier;
if (!spellList[tier]) {
spellList[tier] = [];
}

spellList[tier].push(spell);
}

this.data.spellList = spellList;

return this.data;
}
Expand Down
2 changes: 1 addition & 1 deletion system/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "shadowdark",
"title": "Shadowdark RPG",
"desciption": "A system for playing the Shadowdark RPG from Arcane Library",
"version": "2.2.0",
"version": "2.2.1",
"compatibility": {
"minimum": "11",
"verified": "12"
Expand Down

0 comments on commit 42c4a7e

Please sign in to comment.