aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-29 16:16:12 +0200
committerChocobozzz <me@florianbigard.com>2021-06-29 16:16:12 +0200
commit0ca454e3bdf89390d1a48760ab555ddd8725c82d (patch)
treeec648012f0deb674704732894bd895b336c91b0c /client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts
parent76b8d72e324d3a148beec38ed7b36ccfd5eb4009 (diff)
downloadPeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.tar.gz
PeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.tar.zst
PeerTube-0ca454e3bdf89390d1a48760ab555ddd8725c82d.zip
Only display homepage when components are loaded
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts')
-rw-r--r--client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts
index 3d49c6768..4e802b14d 100644
--- a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts
+++ b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts
@@ -10,6 +10,8 @@ export class CustomMarkupContainerComponent implements OnChanges {
10 10
11 @Input() content: string 11 @Input() content: string
12 12
13 displayed = false
14
13 constructor ( 15 constructor (
14 private customMarkupService: CustomMarkupService 16 private customMarkupService: CustomMarkupService
15 ) { } 17 ) { }
@@ -19,8 +21,13 @@ export class CustomMarkupContainerComponent implements OnChanges {
19 } 21 }
20 22
21 private async buildElement () { 23 private async buildElement () {
22 const element = await this.customMarkupService.buildElement(this.content) 24 if (!this.content) return
23 this.contentWrapper.nativeElement.appendChild(element) 25
24 } 26 const { rootElement, componentsLoaded } = await this.customMarkupService.buildElement(this.content)
27 this.contentWrapper.nativeElement.appendChild(rootElement)
25 28
29 await componentsLoaded
30
31 this.displayed = true
32 }
26} 33}