From dac89a87b736a212224beeba1e01eb4bbe9c8b5b Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 21 Apr 2024 14:20:24 +0300 Subject: [PATCH] Fix new characters highlight --- public/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 7eeb576ce..31344684a 100644 --- a/public/script.js +++ b/public/script.js @@ -6768,8 +6768,9 @@ function select_rm_info(type, charId, previousCharId = null) { importFlashTimeout = setTimeout(function () { if (type === 'char_import' || type === 'char_create') { // Find the page at which the character is located + const avatarFileName = `${charId}.png`; const charData = getEntitiesList({ doFilter: true }); - const charIndex = charData.findIndex((x) => x?.item?.avatar?.startsWith(charId)); + const charIndex = charData.findIndex((x) => x?.item?.avatar?.startsWith(avatarFileName)); if (charIndex === -1) { console.log(`Could not find character ${charId} in the list`); @@ -6779,7 +6780,7 @@ function select_rm_info(type, charId, previousCharId = null) { try { const perPage = Number(localStorage.getItem('Characters_PerPage')) || per_page_default; const page = Math.floor(charIndex / perPage) + 1; - const selector = `#rm_print_characters_block [title^="${charId}"]`; + const selector = `#rm_print_characters_block [title*="${avatarFileName}"]`; $('#rm_print_characters_pagination').pagination('go', page); waitUntilCondition(() => document.querySelector(selector) !== null).then(() => {