Skip to content

Commit

Permalink
fix premature category loading
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Feb 5, 2025
1 parent 9cb1f4f commit 4b87a97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/multiplayer/room.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ async function connectionAcknowledgedQuery ({

document.getElementById('toggle-standard-only').checked = standardOnly;

categoryManager.import({ categories, subcategories, alternateSubcategories, percentView, categoryPercents });
categoryManager.loadCategoryModal();
setCategories({ categories, subcategories, alternateSubcategories, percentView, categoryPercents });

$(document).ready(function () {
$('#slider').slider('values', 0, minYear);
Expand Down Expand Up @@ -595,6 +594,9 @@ function revealAnswer ({ answer, question }) {
function setCategories ({ alternateSubcategories, categories, subcategories, percentView, categoryPercents, username }) {
logEventConditionally(username, 'updated the categories');
categoryManager.import({ categories, subcategories, alternateSubcategories, percentView, categoryPercents });

if (!document.getElementById('category-modal')) { return; }

categoryManager.loadCategoryModal();
}

Expand Down

0 comments on commit 4b87a97

Please sign in to comment.