Merge branch 'staging' into debounce-processHotkeys
This commit is contained in:
commit
78400b4a2e
|
@ -21,6 +21,8 @@ import {
|
|||
saveChatConditional,
|
||||
setAnimationDuration,
|
||||
ANIMATION_DURATION_DEFAULT,
|
||||
setActiveGroup,
|
||||
setActiveCharacter,
|
||||
} from '../script.js';
|
||||
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
||||
import {
|
||||
|
@ -2302,6 +2304,8 @@ async function doRandomChat() {
|
|||
resetSelectedGroup();
|
||||
const characterId = Math.floor(Math.random() * characters.length).toString();
|
||||
setCharacterId(characterId);
|
||||
setActiveCharacter(characters[characterId]?.avatar);
|
||||
setActiveGroup(null);
|
||||
await delay(1);
|
||||
await reloadCurrentChat();
|
||||
return characters[characterId]?.name;
|
||||
|
|
|
@ -25,6 +25,8 @@ import {
|
|||
saveChatConditional,
|
||||
sendMessageAsUser,
|
||||
sendSystemMessage,
|
||||
setActiveCharacter,
|
||||
setActiveGroup,
|
||||
setCharacterId,
|
||||
setCharacterName,
|
||||
setExtensionPrompt,
|
||||
|
@ -1248,11 +1250,15 @@ async function goToCharacterCallback(_, name) {
|
|||
|
||||
if (characterIndex !== -1) {
|
||||
await openChat(new String(characterIndex));
|
||||
setActiveCharacter(characters[characterIndex]?.avatar);
|
||||
setActiveGroup(null);
|
||||
return characters[characterIndex]?.name;
|
||||
} else {
|
||||
const group = groups.find(it => it.name.toLowerCase() == name.toLowerCase());
|
||||
if (group) {
|
||||
await openGroupById(group.id);
|
||||
setActiveCharacter(null);
|
||||
setActiveGroup(group.id);
|
||||
return group.name;
|
||||
} else {
|
||||
console.warn(`No matches found for name "${name}"`);
|
||||
|
|
Loading…
Reference in New Issue