fix
This commit is contained in:
+3
-1
@@ -127,7 +127,7 @@ export function SideBar() {
|
||||
},
|
||||
p("Are you sure you want to delete this layer?")
|
||||
),
|
||||
dialog(
|
||||
() => dialog(
|
||||
{ id: "my_modal_3", class: "modal" },
|
||||
div(
|
||||
{ class: "modal-box text-base-content" },
|
||||
@@ -136,6 +136,7 @@ export function SideBar() {
|
||||
class: "gap-2 flex flex-col",
|
||||
method: "dialog",
|
||||
onsubmit: (e) => {
|
||||
console.log('add new layer');
|
||||
e.preventDefault();
|
||||
const inputText = e.target.elements[1].value;
|
||||
imagePromptsMulti.val = {
|
||||
@@ -218,6 +219,7 @@ function ConfirmDialog({ id, title, onsubmit }, ...children) {
|
||||
button(
|
||||
{
|
||||
type: "submit",
|
||||
autofocus: true,
|
||||
class: "btn btn-sm btn-ghost place-self-end",
|
||||
},
|
||||
"Confirm"
|
||||
|
||||
+8
-6
@@ -242,20 +242,22 @@ function showMyImageEditor(node) {
|
||||
|
||||
const connectedEmbeddingFileName = getWidgetValue(node, 1, "embedding_id");
|
||||
|
||||
showImageEditor.val = true;
|
||||
|
||||
imagePrompts.val = JSON.parse(
|
||||
const v = JSON.parse(
|
||||
node.widgets.find((x) => x.name === "image_prompts_json").value
|
||||
);
|
||||
if (!Array.isArray(imagePrompts.val)) {
|
||||
imagePromptsMulti.val = imagePrompts.val;
|
||||
|
||||
if (!Array.isArray(v)) {
|
||||
// this is a multi prompt
|
||||
imagePromptsMulti.val = v;
|
||||
selectedLayer.val = Object.keys(imagePromptsMulti.val)[0];
|
||||
|
||||
imagePrompts.val = imagePromptsMulti.val[selectedLayer.val];
|
||||
} else {
|
||||
// this is a single prompt
|
||||
selectedLayer.val = "";
|
||||
imagePromptsMulti.val = {};
|
||||
imagePrompts.val = v;
|
||||
}
|
||||
showImageEditor.val = true;
|
||||
imageUrl.val = api.apiURL(
|
||||
`/view?filename=${encodeURIComponent(
|
||||
connectedImageFileName
|
||||
|
||||
Reference in New Issue
Block a user