From a9ca5d11edc6a384fe7ec975e1a530db06a509be Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sun, 27 Aug 2023 13:47:02 +0100 Subject: [PATCH] Fix removing extension --- web/js/modelInfo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/js/modelInfo.js b/web/js/modelInfo.js index dd372a7..2990e46 100644 --- a/web/js/modelInfo.js +++ b/web/js/modelInfo.js @@ -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"}`; } }