Fix gallery for first in the list

This commit is contained in:
Cohee 2025-02-28 10:36:26 +02:00
parent 16b62d9fb3
commit 50e49cd67b

View File

@ -169,7 +169,7 @@ async function showCharGallery() {
try {
let url = selected_group || this_chid;
if (!selected_group && this_chid) {
if (!selected_group && this_chid !== undefined) {
const char = characters[this_chid];
url = char.avatar.replace('.png', '');
}
@ -455,7 +455,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
async function listGalleryCommand(args) {
try {
let url = args.char ?? (args.group ? groups.find(it => it.name == args.group)?.id : null) ?? (selected_group || this_chid);
if (!args.char && !args.group && !selected_group && this_chid) {
if (!args.char && !args.group && !selected_group && this_chid !== undefined) {
const char = characters[this_chid];
url = char.avatar.replace('.png', '');
}