diff --git a/src/js/states/puzzle_menu.js b/src/js/states/puzzle_menu.js index b3d8d361..22a492d5 100644 --- a/src/js/states/puzzle_menu.js +++ b/src/js/states/puzzle_menu.js @@ -1,4 +1,3 @@ -import { globalConfig } from "../core/config"; import { createLogger } from "../core/logging"; import { DialogWithForm } from "../core/modal_dialog_elements"; import { FormElementInput } from "../core/modal_dialog_forms"; @@ -11,8 +10,8 @@ import { Savegame } from "../savegame/savegame"; import { T } from "../translations"; const navigation = { - categories: ["official", "top-rated", "trending", "new"], - difficulties: ["easy", "medium", "hard", "short"], + categories: ["official", "top-rated", "trending", "trending-weekly", "new"], + difficulties: ["easy", "medium", "hard"], account: ["mine", "completed"], }; @@ -72,6 +71,7 @@ export class PuzzleMenuState extends TextualGameState {
+ @@ -147,7 +147,10 @@ export class PuzzleMenuState extends TextualGameState { activeCategory.classList.remove("active"); } - this.htmlElement.querySelector(`[data-root-category="${rootCategory}"]`).classList.add("active"); + const newActiveCategory = this.htmlElement.querySelector(`[data-root-category="${rootCategory}"]`); + if (newActiveCategory) { + newActiveCategory.classList.add("active"); + } // Rerender buttons @@ -206,7 +209,7 @@ export class PuzzleMenuState extends TextualGameState { elem.appendChild(stats); if ( - puzzle.downloads > 0 && + puzzle.downloads > 3 && !["official", "easy", "medium", "hard"].includes(this.activeCategory) ) { const difficulty = document.createElement("div"); diff --git a/translations/base-en.yaml b/translations/base-en.yaml index 791be47e..0b094b69 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -141,16 +141,17 @@ puzzleMenu: new: New top-rated: Top Rated mine: Created - short: Short easy: Easy medium: Medium hard: Hard completed: Completed official: Official trending: Trending today + trending-weekly: Trending weekly categories: Categories difficulties: By Difficulty account: My Puzzles + search: Search difficulties: easy: Easy