Refactor save method to remove base64 encoding for page content
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-06-27 00:31:08 +02:00
parent d5c7d8fc27
commit 3576d5e034
2 changed files with 38 additions and 3 deletions

View File

@@ -37,9 +37,8 @@ export class OpenEditPage {
contentToSave += "---\n\n";
}
contentToSave += this.content;
const encodedContent = btoa(new TextEncoder().encode(contentToSave).reduce((data, byte) => data + String.fromCharCode(byte), ""));
await get(pageRepo).updatePage(this.pageId, encodedContent, this.sha, prompt("Was hast du geändert?", `Updated ${this.pageTitle}`) ?? `Updated ${this.pageTitle}`, this.manager.branch);
await get(pageRepo).updatePage(this.pageId, contentToSave, this.sha, prompt("Was hast du geändert?", `Updated ${this.pageTitle}`) ?? `Updated ${this.pageTitle}`, this.manager.branch);
this.dirty = false;
this.manager.reloadImages();
}