Fix gallery for first in the list

50e49cd67b476fe5f7d9393aa4d5b83e324f2b75

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -2Ignore whitespace
public/scripts/extensions/gallery/index.js+2 -2
@@ -169,7 +169,7 @@ async function showCharGallery() {
169169
170 try {170 try {
171 let url = selected_group || this_chid;171 let url = selected_group || this_chid;
172 if (!selected_group && this_chid) {172 if (!selected_group && this_chid !== undefined) {
173 const char = characters[this_chid];173 const char = characters[this_chid];
174 url = char.avatar.replace('.png', '');174 url = char.avatar.replace('.png', '');
175 }175 }
@@ -455,7 +455,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
455async function listGalleryCommand(args) {455async function listGalleryCommand(args) {
456 try {456 try {
457 let url = args.char ?? (args.group ? groups.find(it => it.name == args.group)?.id : null) ?? (selected_group || this_chid);457 let url = args.char ?? (args.group ? groups.find(it => it.name == args.group)?.id : null) ?? (selected_group || this_chid);
458 if (!args.char && !args.group && !selected_group && this_chid) {458 if (!args.char && !args.group && !selected_group && this_chid !== undefined) {
459 const char = characters[this_chid];459 const char = characters[this_chid];
460 url = char.avatar.replace('.png', '');460 url = char.avatar.replace('.png', '');
461 }461 }