Fix new characters highlight

This commit is contained in:
Cohee 2024-04-21 14:20:24 +03:00
parent fb5d998cd0
commit dac89a87b7
1 changed files with 3 additions and 2 deletions

View File

@ -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(() => {