From 4fc2f15448fac2e6e8c15546958a9dcc39932bd7 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 23 Dec 2023 07:54:44 -0500 Subject: [PATCH] Reformat up Generate() group logic The first two conditions in the group if/else blocks are the same, so we can combine them. --- public/script.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/script.js b/public/script.js index 06f362b82..78454a016 100644 --- a/public/script.js +++ b/public/script.js @@ -2978,10 +2978,12 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu chat_metadata['tainted'] = true; } - if (selected_group && !is_group_generating && !dryRun) { - // Returns the promise that generateGroupWrapper returns; resolves when generation is done - return generateGroupWrapper(false, type, { quiet_prompt, force_chid, signal: abortController.signal, quietImage, maxLoops }); - } else 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 + return generateGroupWrapper(false, type, { quiet_prompt, force_chid, signal: abortController.signal, quietImage, maxLoops }); + } + const characterIndexMap = new Map(characters.map((char, index) => [char.avatar, index])); const group = groups.find((x) => x.id === selected_group);