- forkJoin([
- this.instanceService.getAbout(),
- this.serverService.localeObservable.pipe(first()),
- this.serverService.videoLanguagesLoaded.pipe(first()),
- this.serverService.videoCategoriesLoaded.pipe(first())
- ]).subscribe(
- async ([ res, translations ]) => {
- this.shortDescription = res.instance.shortDescription
-
- this.maintenanceLifetime = res.instance.maintenanceLifetime
- this.businessModel = res.instance.businessModel
-
- for (const key of [ 'description', 'terms', 'codeOfConduct', 'moderationInformation', 'administrator' ]) {
- this.html[ key ] = await this.markdownService.textMarkdownToHTML(res.instance[ key ])
- }
-
- const languagesArray = this.serverService.getVideoLanguages()
- const categoriesArray = this.serverService.getVideoCategories()
-
- this.languages = res.instance.languages
- .map(l => {
- const languageObj = languagesArray.find(la => la.id === l)
-
- return peertubeTranslate(languageObj.label, translations)
- })
-
- this.categories = res.instance.categories
- .map(c => {
- const categoryObj = categoriesArray.find(ca => ca.id === c)
-
- return peertubeTranslate(categoryObj.label, translations)
- })
- },
-
- () => this.notifier.error(this.i18n('Cannot get about information from server'))
- )
+ const { about, languages, categories, aboutHTML, descriptionElement, serverStats }: ResolverData = this.route.snapshot.data.instanceData
+
+ this.serverStats = serverStats
+
+ this.aboutHTML = aboutHTML
+ this.descriptionElement = descriptionElement
+
+ this.languages = languages
+ this.categories = categories
+
+ this.shortDescription = about.instance.shortDescription
+
+ this.serverConfig = this.serverService.getHTMLConfig()
+
+ this.route.data.subscribe(data => {
+ if (!data?.isContact) return
+
+ const prefill = this.route.snapshot.queryParams
+
+ this.contactAdminModal.show(prefill)
+ })
+
+ this.initialized = true
+ }
+
+ ngAfterViewChecked () {
+ if (this.initialized && window.location.hash && window.location.hash !== this.lastScrollHash) {
+ this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', ''))
+
+ this.lastScrollHash = window.location.hash
+ }