1 import { Component, ElementRef, ViewChild } from '@angular/core'
2 import { Notifier } from '@app/core'
3 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 import { About } from '@shared/models/server'
5 import { UserService } from '@app/shared'
8 selector: 'my-instance-config-warning-modal',
9 templateUrl: './instance-config-warning-modal.component.html',
10 styleUrls: [ './instance-config-warning-modal.component.scss' ]
12 export class InstanceConfigWarningModalComponent {
13 @ViewChild('modal', { static: true }) modal: ElementRef
15 stopDisplayModal = false
19 private userService: UserService,
20 private modalService: NgbModal,
21 private notifier: Notifier
27 const ref = this.modalService.open(this.modal)
29 ref.result.finally(() => {
30 if (this.stopDisplayModal === true) this.doNotOpenAgain()
34 isDefaultShortDescription (description: string) {
35 return description === 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly ' +
36 'in the web browser with WebTorrent and Angular.'
39 private doNotOpenAgain () {
40 this.userService.updateMyProfile({ noInstanceConfigWarningModal: true })
42 () => console.log('We will not open the instance config warning modal again.'),
44 err => this.notifier.error(err.message)