mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-26 00:47:42 +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() {
|
function doRandomChat() {
|
||||||
resetSelectedGroup();
|
resetSelectedGroup();
|
||||||
setCharacterId(Math.floor(Math.random() * characters.length));
|
setCharacterId(Math.floor(Math.random() * characters.length).toString());
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
reloadCurrentChat();
|
reloadCurrentChat();
|
||||||
}, 1);
|
}, 1);
|
||||||
|
@ -192,7 +192,7 @@ function goToCharacterCallback(_, name) {
|
|||||||
const characterIndex = findCharacterIndex(name);
|
const characterIndex = findCharacterIndex(name);
|
||||||
|
|
||||||
if (characterIndex !== -1) {
|
if (characterIndex !== -1) {
|
||||||
openChat(characterIndex);
|
openChat(new String(characterIndex));
|
||||||
} else {
|
} else {
|
||||||
console.warn(`No matches found for name "${name}"`);
|
console.warn(`No matches found for name "${name}"`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user