mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-25 16:37:50 +01:00
Fix opening character with id = '0' in /go and /random commands
This commit is contained in:
parent
cf3baccc5e
commit
260bb0af52
@ -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);
|
||||
|
@ -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}"`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user