- this.serverConfig = this.serverService.getTmpConfig()
- this.serverService.getConfig()
- .subscribe(config => this.serverConfig = config)
-
- this.instanceService.getAbout()
- .pipe(
- switchMap(about => {
- return forkJoin([
- this.instanceService.buildTranslatedLanguages(about),
- this.instanceService.buildTranslatedCategories(about)
- ]).pipe(map(([ languages, categories ]) => ({ about, languages, categories })))
- })
- ).subscribe(
- async ({ about, languages, categories }) => {
- this.languages = languages
- this.categories = categories
-
- this.shortDescription = about.instance.shortDescription
-
- this.creationReason = about.instance.creationReason
- this.maintenanceLifetime = about.instance.maintenanceLifetime
- this.businessModel = about.instance.businessModel
-
- this.html = await this.instanceService.buildHtml(about)
- },
-
- () => 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
+ }