From 96db006c995b09622d192fd7f7d398582ed3140d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 19 Aug 2024 08:23:18 +1000 Subject: [PATCH] fix(ui): edge case with getViewModeChunks --- .../web/src/features/stylePresets/util/getViewModeChunks.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/stylePresets/util/getViewModeChunks.tsx b/invokeai/frontend/web/src/features/stylePresets/util/getViewModeChunks.tsx index f4a0126f27..18eb4ab695 100644 --- a/invokeai/frontend/web/src/features/stylePresets/util/getViewModeChunks.tsx +++ b/invokeai/frontend/web/src/features/stylePresets/util/getViewModeChunks.tsx @@ -11,7 +11,7 @@ export const getViewModeChunks = (currentPrompt: string, presetPrompt?: string): } // Otherwise, we split the preset prompt into 3 parts: before, current, and after the placeholder - const [before, after] = presetPrompt.split(PRESET_PLACEHOLDER, 2); + const [before, ...after] = presetPrompt.split(PRESET_PLACEHOLDER); - return [before || '', currentPrompt, after || '']; + return [before || '', currentPrompt, after.join(PRESET_PLACEHOLDER) || '']; };