diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-10-12 20:37:19 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-10-12 20:37:19 -0300 |
commit | 43610c3dbef9a34fc66eed6b0bf7b22f989635c5 (patch) | |
tree | 3d6fa5ef4f174c61c3f8687468481969175ebdba /src/util/wiki-data.js | |
parent | 76fb4dc0d70e60ddd30539bee3be6a7d3f44fad8 (diff) | |
parent | 428e14394209f55215168b9acbe680a982f9beb6 (diff) |
Merge branch 'preview' into networked-tags
Diffstat (limited to 'src/util/wiki-data.js')
-rw-r--r-- | src/util/wiki-data.js | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js index a85dd9a2..ebdbcc92 100644 --- a/src/util/wiki-data.js +++ b/src/util/wiki-data.js @@ -642,20 +642,9 @@ export function sortFlashesChronologically(data, { latestFirst = false, getDate, } = {}) { - // Flash acts don't actually have any identifying properties because they - // don't have dedicated pages (yet), so don't have a directory. Make up a - // fake key identifying them so flashes can be grouped together. - const flashActs = new Set(data.map(flash => flash.act)); - const flashActIdentifiers = new Map(); - - let counter = 0; - for (const act of flashActs) { - flashActIdentifiers.set(act, ++counter); - } - // Group flashes by act... - data.sort((a, b) => { - return flashActIdentifiers.get(a.act) - flashActIdentifiers.get(b.act); + sortByDirectory(data, { + getDirectory: flash => flash.act.directory, }); // Sort flashes by position in act... |