Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-03-29 01:03:59 +01:00 committed by GitHub
parent bdf6dede04
commit 97f0a1e221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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("");