From ae318132395af87b38eb381112bdb3376bcb511b Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Wed, 28 Dec 2022 18:52:18 -0800 Subject: [PATCH] Restore the original prompt if provided Restore the original prompt if provided... including if it's empty now that empty prompts are allowed if there are modifiers. --- ui/media/js/dnd.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 4d3f8af8..0f4c9dcf 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -294,9 +294,12 @@ function restoreTaskToUI(task, fieldsToSkip) { } } - // restore the original tag - promptField.value = task.reqBody.original_prompt || task.reqBody.prompt - + // restore the original prompt if provided (e.g. use settings), fallback to prompt as needed (e.g. copy/paste or d&d) + promptField.value = task.reqBody.original_prompt + if (!('original_prompt' in task.reqBody)) { + promptField.value = task.reqBody.prompt + } + // properly reset checkboxes if (!('use_face_correction' in task.reqBody)) { useFaceCorrectionField.checked = false