From 97f0a1e2218aa6ddb26db3687319ba352d55d205 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 29 Mar 2025 01:03:59 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/ui/pokedex-page-ui-handler.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 985d030ddb8..53f4dd31b59 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -2026,7 +2026,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } break; case Button.LEFT: - if (this.filteredIndices && this.filteredIndices.length <= 1) { + if (this.filteredIndices?.length <= 1) { ui.playError(); this.blockInput = false; return true; @@ -2066,7 +2066,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.blockInput = false; break; case Button.RIGHT: - if (this.filteredIndices && this.filteredIndices.length <= 1) { + if (this.filteredIndices?.length <= 1) { ui.playError(); this.blockInput = false; return true; @@ -2230,10 +2230,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler { const ui = this.getUi(); - const isFormCaught = this.isFormCaught(); - const isSeen = this.isSeen(); - if ((this.isCaught() && isFormCaught) || isSeen) { + if ((this.isCaught() && this.isFormCaught()) || this.isSeen()) { ui.showText(this.menuDescriptions[cursor]); } else { ui.showText("");