aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+about/about-instance/about-instance.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+about/about-instance/about-instance.component.ts')
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.ts41
1 files changed, 15 insertions, 26 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts
index 0826bbc5a..e1501d7de 100644
--- a/client/src/app/+about/about-instance/about-instance.component.ts
+++ b/client/src/app/+about/about-instance/about-instance.component.ts
@@ -2,7 +2,7 @@ import { ViewportScroller } from '@angular/common'
2import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core' 2import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core'
3import { ActivatedRoute } from '@angular/router' 3import { ActivatedRoute } from '@angular/router'
4import { Notifier, ServerService } from '@app/core' 4import { Notifier, ServerService } from '@app/core'
5import { InstanceService } from '@app/shared/shared-instance' 5import { AboutHTML } from '@app/shared/shared-instance'
6import { copyToClipboard } from '@root-helpers/utils' 6import { copyToClipboard } from '@root-helpers/utils'
7import { HTMLServerConfig } from '@shared/models/server' 7import { HTMLServerConfig } from '@shared/models/server'
8import { ResolverData } from './about-instance.resolver' 8import { ResolverData } from './about-instance.resolver'
@@ -17,22 +17,12 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
17 @ViewChild('descriptionWrapper') descriptionWrapper: ElementRef<HTMLInputElement> 17 @ViewChild('descriptionWrapper') descriptionWrapper: ElementRef<HTMLInputElement>
18 @ViewChild('contactAdminModal', { static: true }) contactAdminModal: ContactAdminModalComponent 18 @ViewChild('contactAdminModal', { static: true }) contactAdminModal: ContactAdminModalComponent
19 19
20 shortDescription = '' 20 aboutHTML: AboutHTML
21 descriptionContent: string 21 descriptionElement: HTMLDivElement
22
23 html = {
24 terms: '',
25 codeOfConduct: '',
26 moderationInformation: '',
27 administrator: '',
28 creationReason: '',
29 maintenanceLifetime: '',
30 businessModel: '',
31 hardwareInformation: ''
32 }
33 22
34 languages: string[] = [] 23 languages: string[] = []
35 categories: string[] = [] 24 categories: string[] = []
25 shortDescription = ''
36 26
37 initialized = false 27 initialized = false
38 28
@@ -44,8 +34,7 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
44 private viewportScroller: ViewportScroller, 34 private viewportScroller: ViewportScroller,
45 private route: ActivatedRoute, 35 private route: ActivatedRoute,
46 private notifier: Notifier, 36 private notifier: Notifier,
47 private serverService: ServerService, 37 private serverService: ServerService
48 private instanceService: InstanceService
49 ) {} 38 ) {}
50 39
51 get instanceName () { 40 get instanceName () {
@@ -60,8 +49,16 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
60 return this.serverConfig.instance.isNSFW 49 return this.serverConfig.instance.isNSFW
61 } 50 }
62 51
63 async ngOnInit () { 52 ngOnInit () {
64 const { about, languages, categories }: ResolverData = this.route.snapshot.data.instanceData 53 const { about, languages, categories, aboutHTML, descriptionElement }: ResolverData = this.route.snapshot.data.instanceData
54
55 this.aboutHTML = aboutHTML
56 this.descriptionElement = descriptionElement
57
58 this.languages = languages
59 this.categories = categories
60
61 this.shortDescription = about.instance.shortDescription
65 62
66 this.serverConfig = this.serverService.getHTMLConfig() 63 this.serverConfig = this.serverService.getHTMLConfig()
67 64
@@ -73,14 +70,6 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
73 this.contactAdminModal.show(prefill) 70 this.contactAdminModal.show(prefill)
74 }) 71 })
75 72
76 this.languages = languages
77 this.categories = categories
78
79 this.shortDescription = about.instance.shortDescription
80 this.descriptionContent = about.instance.description
81
82 this.html = await this.instanceService.buildHtml(about)
83
84 this.initialized = true 73 this.initialized = true
85 } 74 }
86 75