Fix removing extension

This commit is contained in:
pythongosssss
2023-08-27 13:47:02 +01:00
parent f69e5ffa7b
commit a9ca5d11ed
+5 -1
View File
@@ -120,7 +120,11 @@ class ModelInfoDialog extends ComfyDialog {
} while (m);
return $el("span", notes);
} else {
return `Add custom notes in ${this.name.split(".")[0] + ".txt"}`;
let last = this.name.lastIndexOf(".");
if (last === -1) {
last = this.name.length;
}
return `Add custom notes in ${this.name.substring(0, last) + ".txt"}`;
}
}