Reformat up Generate() group logic

The first two conditions in the group if/else blocks are the same, so we
can combine them.
This commit is contained in:
valadaptive 2023-12-23 07:54:44 -05:00
parent 0d3505c44b
commit 4fc2f15448
1 changed files with 6 additions and 4 deletions

View File

@ -2978,10 +2978,12 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
chat_metadata['tainted'] = true; chat_metadata['tainted'] = true;
} }
if (selected_group && !is_group_generating && !dryRun) { if (selected_group && !is_group_generating) {
if (!dryRun) {
// Returns the promise that generateGroupWrapper returns; resolves when generation is done // Returns the promise that generateGroupWrapper returns; resolves when generation is done
return generateGroupWrapper(false, type, { quiet_prompt, force_chid, signal: abortController.signal, quietImage, maxLoops }); return generateGroupWrapper(false, type, { quiet_prompt, force_chid, signal: abortController.signal, quietImage, maxLoops });
} else if (selected_group && !is_group_generating && dryRun) { }
const characterIndexMap = new Map(characters.map((char, index) => [char.avatar, index])); const characterIndexMap = new Map(characters.map((char, index) => [char.avatar, index]));
const group = groups.find((x) => x.id === selected_group); const group = groups.find((x) => x.id === selected_group);