Fix some errors

This commit is contained in:
alethiophile 2023-05-07 04:17:36 +00:00
parent aa2e2c02ff
commit ce62d78b13
2 changed files with 8 additions and 4 deletions

View File

@ -310,9 +310,7 @@ class ComfyApi extends EventTarget {
// I'll just use client storage for now // I'll just use client storage for now
try { try {
const r = load_saved(); const r = load_saved();
console.log("r is", r);
return { Saved: Object.values(r).map((i) => { return { Saved: Object.values(r).map((i) => {
console.log(i);
i['remove'] = { i['remove'] = {
name: "Delete", name: "Delete",
cb: () => { cb: () => {

View File

@ -263,15 +263,19 @@ class ComfyList {
async show() { async show() {
this.element.style.display = "block"; this.element.style.display = "block";
if (this.button) {
this.button.textContent = "Close"; this.button.textContent = "Close";
}
await this.load(); await this.load();
} }
hide() { hide() {
this.element.style.display = "none"; this.element.style.display = "none";
if (this.button) {
this.button.textContent = "View " + this.#text; this.button.textContent = "View " + this.#text;
} }
}
toggle() { toggle() {
if (this.visible) { if (this.visible) {
@ -545,6 +549,7 @@ export class ComfyUI {
}; };
list[name] = new_item; list[name] = new_item;
save_saved(list); save_saved(list);
this.saved.update();
}, },
}), }),
$el("button", { $el("button", {
@ -632,6 +637,7 @@ export class ComfyUI {
}), }),
]); ]);
this.saved.show(); this.saved.show();
this.saved.update();
const devMode = this.settings.addSetting({ const devMode = this.settings.addSetting({
id: "Comfy.DevMode", id: "Comfy.DevMode",