Fix for new trimming rule cutting off first letter

if Loras weren't in a subfolder
This commit is contained in:
DominikDoom
2023-08-07 17:51:21 +02:00
parent 14a4440c33
commit 90d144a5f4
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)