From 90d144a5f4215773dfb49b78b9bfee21147e6bb7 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Mon, 7 Aug 2023 17:51:21 +0200 Subject: [PATCH] Fix for new trimming rule cutting off first letter if Loras weren't in a subfolder --- javascript/ext_loras.js | 2 +- javascript/ext_lycos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/ext_loras.js b/javascript/ext_loras.js index 44ad8f0..9a94b75 100644 --- a/javascript/ext_loras.js +++ b/javascript/ext_loras.js @@ -18,7 +18,7 @@ class LoraParser extends BaseTagParser { tempResults.forEach(t => { const text = t[0].trim(); let lastDot = text.lastIndexOf(".") > -1 ? text.lastIndexOf(".") : text.length; - let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : 0; + let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : -1; let name = text.substring(lastSlash + 1, lastDot); let result = new AutocompleteResult(name, ResultType.lora) diff --git a/javascript/ext_lycos.js b/javascript/ext_lycos.js index 9fd8ac1..dd1b439 100644 --- a/javascript/ext_lycos.js +++ b/javascript/ext_lycos.js @@ -18,7 +18,7 @@ class LycoParser extends BaseTagParser { tempResults.forEach(t => { const text = t[0].trim(); let lastDot = text.lastIndexOf(".") > -1 ? text.lastIndexOf(".") : text.length; - let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : 0; + let lastSlash = text.lastIndexOf("/") > -1 ? text.lastIndexOf("/") : -1; let name = text.substring(lastSlash + 1, lastDot); let result = new AutocompleteResult(name, ResultType.lyco)