mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-23 16:02:06 +01:00
Fix new characters highlight
This commit is contained in:
parent
fb5d998cd0
commit
dac89a87b7
@ -6768,8 +6768,9 @@ function select_rm_info(type, charId, previousCharId = null) {
|
|||||||
importFlashTimeout = setTimeout(function () {
|
importFlashTimeout = setTimeout(function () {
|
||||||
if (type === 'char_import' || type === 'char_create') {
|
if (type === 'char_import' || type === 'char_create') {
|
||||||
// Find the page at which the character is located
|
// Find the page at which the character is located
|
||||||
|
const avatarFileName = `${charId}.png`;
|
||||||
const charData = getEntitiesList({ doFilter: true });
|
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) {
|
if (charIndex === -1) {
|
||||||
console.log(`Could not find character ${charId} in the list`);
|
console.log(`Could not find character ${charId} in the list`);
|
||||||
@ -6779,7 +6780,7 @@ function select_rm_info(type, charId, previousCharId = null) {
|
|||||||
try {
|
try {
|
||||||
const perPage = Number(localStorage.getItem('Characters_PerPage')) || per_page_default;
|
const perPage = Number(localStorage.getItem('Characters_PerPage')) || per_page_default;
|
||||||
const page = Math.floor(charIndex / perPage) + 1;
|
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);
|
$('#rm_print_characters_pagination').pagination('go', page);
|
||||||
|
|
||||||
waitUntilCondition(() => document.querySelector(selector) !== null).then(() => {
|
waitUntilCondition(() => document.querySelector(selector) !== null).then(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user