From 09a81ec03298538d7e0cea33654e8f3979b6043c Mon Sep 17 00:00:00 2001 From: liquidev Date: Thu, 5 Sep 2024 22:05:15 +0200 Subject: [PATCH] fix brush editor not saving your brush --- static/brush-editor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/brush-editor.js b/static/brush-editor.js index b0ff273..f90361f 100644 --- a/static/brush-editor.js +++ b/static/brush-editor.js @@ -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,