From 4e7cd6d63b096f3242e2303c8d3902717c056954 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 26 Mar 2024 18:30:12 +0200 Subject: [PATCH] Set active character for /random --- public/scripts/power-user.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 5628793bc..d0cc3fc06 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -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;