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:
parent
2f7bcbb14e
commit
2594afcc1b
6 changed files with 57 additions and 49 deletions
|
@ -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,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue