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