mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix newlines
Because sometimes it just doesn't work
This commit is contained in:
@@ -7016,6 +7016,7 @@ async function showScreenshotWizard(actionComposition, startDebt, endDebt) {
|
||||
|
||||
screenshotTextContainer.innerHTML = "";
|
||||
let charCount = startDebt;
|
||||
let i = 0;
|
||||
for (const action of actionComposition) {
|
||||
for (const chunk of action) {
|
||||
// Account for debt
|
||||
@@ -7034,10 +7035,14 @@ async function showScreenshotWizard(actionComposition, startDebt, endDebt) {
|
||||
break;
|
||||
} else if (charCount + chunk.content.length > endDebt) {
|
||||
let charsLeft = endDebt - charCount
|
||||
chunk.content = chunk.content.slice(0, charsLeft);
|
||||
chunk.content = chunk.content.slice(0, charsLeft).trimEnd();
|
||||
endDebt = -1;
|
||||
}
|
||||
|
||||
|
||||
if (i == 0) chunk.content = chunk.content.trimStart();
|
||||
i++;
|
||||
|
||||
charCount += chunk.content.length;
|
||||
|
||||
let actionClass = {
|
||||
@@ -7054,11 +7059,6 @@ async function showScreenshotWizard(actionComposition, startDebt, endDebt) {
|
||||
}
|
||||
}
|
||||
|
||||
const firstAction = screenshotTextContainer.children[0];
|
||||
const lastAction = screenshotTextContainer.children[screenshotTextContainer.children.length-1];
|
||||
firstAction.innerText = firstAction.innerText.trimStart();
|
||||
lastAction.innerText = lastAction.innerText.trimEnd();
|
||||
|
||||
let imageData = await (await fetch("/image_db.json")).json();
|
||||
screenshotImagePicker.innerHTML = "";
|
||||
|
||||
|
Reference in New Issue
Block a user