Skip to content

Commit

Permalink
Fix category search index modifying original data
Browse files Browse the repository at this point in the history
Fix the category search index builder modifying the data of the original question pool for individual categories, causing them to subsequently display filtered, notably in all capital letters.
  • Loading branch information
LakeYS committed May 25, 2020
1 parent 71e06e8 commit 100c30e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion triviabot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ commands.triviaPing = require("./lib/cmd_ping.js")(Config, Trivia, Database);
commands.triviaStop = require("./lib/cmd_stop.js")(Config, Trivia, commands, getConfigVal);

Trivia.buildCategorySearchIndex = async () => {
Trivia.categorySearchIndex = await Database.getCategories();
Trivia.categorySearchIndex = JSON.parse(JSON.stringify(await Database.getCategories()));

for(var el in Trivia.categorySearchIndex) {
var index = Trivia.categorySearchIndex[el];
Expand Down

0 comments on commit 100c30e

Please sign in to comment.