From 8a1bc0243ef36c654602a19608934e327faf6d6f Mon Sep 17 00:00:00 2001 From: Aidan Pine Date: Tue, 23 Jul 2024 15:18:58 -0700 Subject: [PATCH] fix(slots): fix slot reloading fixes #327 --- packages/studio-web/src/app/editor/editor.component.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/studio-web/src/app/editor/editor.component.ts b/packages/studio-web/src/app/editor/editor.component.ts index 152d5336..eda63ea2 100644 --- a/packages/studio-web/src/app/editor/editor.component.ts +++ b/packages/studio-web/src/app/editor/editor.component.ts @@ -210,10 +210,7 @@ export class EditorComponent implements OnDestroy, OnInit, AfterViewInit { ); if (titleSlot) { - if (this.editorService.slots.title) { - titleSlot.innerText = this.editorService.slots.title; - } - // this.editorService.slots.title = titleSlot.innerText; + this.editorService.slots.title = titleSlot.innerText; titleSlot.setAttribute("contenteditable", true); // Because we're just loading this from the single-file HTML, it's cumbersome to // use Angular event input event listeners like we do in the demo @@ -223,9 +220,7 @@ export class EditorComponent implements OnDestroy, OnInit, AfterViewInit { ); } if (subtitleSlot) { - if (this.editorService.slots.subtitle) { - subtitleSlot.innerText = this.editorService.slots.subtitle; - } + this.editorService.slots.subtitle = subtitleSlot.innerText; subtitleSlot.setAttribute("contenteditable", true); subtitleSlot.addEventListener( "input",