Fix opening character with id = '0' in /go and /random commands

This commit is contained in:
Cohee 2023-07-24 17:22:51 +03:00
parent cf3baccc5e
commit 260bb0af52
2 changed files with 2 additions and 2 deletions

View File

@ -1182,7 +1182,7 @@ function doNewChat() {
function doRandomChat() {
resetSelectedGroup();
setCharacterId(Math.floor(Math.random() * characters.length));
setCharacterId(Math.floor(Math.random() * characters.length).toString());
setTimeout(() => {
reloadCurrentChat();
}, 1);

View File

@ -192,7 +192,7 @@ function goToCharacterCallback(_, name) {
const characterIndex = findCharacterIndex(name);
if (characterIndex !== -1) {
openChat(characterIndex);
openChat(new String(characterIndex));
} else {
console.warn(`No matches found for name "${name}"`);
}