fix brush editor not saving your brush

This commit is contained in:
liquidex 2024-09-05 22:05:15 +02:00
parent b8d6b3edb3
commit 09a81ec032

View file

@ -19,6 +19,8 @@ export class BrushEditor extends HTMLElement {
this.codeEditor = this.appendChild(new CodeEditor());
this.codeEditor.setCode(localStorage.getItem("rkgk.brushEditor.code") ?? defaultBrush);
this.codeEditor.addEventListener(".codeChanged", (event) => {
localStorage.setItem("rkgk.brushEditor.code", event.newCode);
this.dispatchEvent(
Object.assign(new Event(".codeChanged"), {
newCode: event.newCode,