a more robust system for syncing chunks

as long as the server tells you there are more chunks, there are definitely more chunks.
just wait for them a bit.
This commit is contained in:
りき萌 2024-08-17 22:16:31 +02:00
parent 2f7bcbb14e
commit 2594afcc1b
6 changed files with 57 additions and 49 deletions

View file

@ -17,13 +17,14 @@ export class BrushEditor extends HTMLElement {
this.textArea = this.appendChild(document.createElement("pre"));
this.textArea.classList.add("text-area");
this.textArea.textContent = defaultBrush;
this.textArea.textContent = localStorage.getItem("rkgk.brushEditor.code") ?? defaultBrush;
this.textArea.contentEditable = true;
this.textArea.spellcheck = false;
this.textArea.addEventListener("input", () => {
localStorage.setItem("rkgk.brushEditor.code", this.code);
this.dispatchEvent(
Object.assign(new Event(".codeChanged"), {
newCode: this.textArea.value,
newCode: this.code,
}),
);
});