]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+about/about-instance/about-instance.component.ts
Migrate client to eslint
[github/Chocobozzz/PeerTube.git] / client / src / app / +about / about-instance / about-instance.component.ts
index f02048f39eef9ed53650aaa4e4e616fd888dce99..0826bbc5a198bfb59c0b50b0a1ab48b9fdf9e6f2 100644 (file)
@@ -1,13 +1,12 @@
 import { ViewportScroller } from '@angular/common'
 import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core'
 import { ActivatedRoute } from '@angular/router'
-import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component'
 import { Notifier, ServerService } from '@app/core'
-import { CustomMarkupService } from '@app/shared/shared-custom-markup'
 import { InstanceService } from '@app/shared/shared-instance'
-import { About, HTMLServerConfig, ServerConfig } from '@shared/models'
-import { copyToClipboard } from '../../../root-helpers/utils'
+import { copyToClipboard } from '@root-helpers/utils'
+import { HTMLServerConfig } from '@shared/models/server'
 import { ResolverData } from './about-instance.resolver'
+import { ContactAdminModalComponent } from './contact-admin-modal.component'
 
 @Component({
   selector: 'my-about-instance',
@@ -66,6 +65,14 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
 
     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.languages = languages
     this.categories = categories
 
@@ -85,13 +92,9 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
     }
   }
 
-  openContactModal () {
-    return this.contactAdminModal.show()
-  }
-
   onClickCopyLink (anchor: HTMLAnchorElement) {
     const link = anchor.href
     copyToClipboard(link)
-    this.notifier.success(link, $localize `Link copied`)
+    this.notifier.success(link, $localize`Link copied`)
   }
 }