]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/modal/welcome-modal.component.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / modal / welcome-modal.component.ts
1 import { Component, ElementRef, ViewChild } from '@angular/core'
2 import { Notifier } from '@app/core'
3 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 import { UserService } from '@app/shared'
5
6 @Component({
7 selector: 'my-welcome-modal',
8 templateUrl: './welcome-modal.component.html',
9 styleUrls: [ './welcome-modal.component.scss' ]
10 })
11 export class WelcomeModalComponent {
12 @ViewChild('modal', { static: true }) modal: ElementRef
13
14 constructor (
15 private userService: UserService,
16 private modalService: NgbModal,
17 private notifier: Notifier
18 ) { }
19
20 show () {
21 this.modalService.open(this.modal,{
22 backdrop: 'static',
23 keyboard: false,
24 size: 'lg'
25 })
26 }
27
28 doNotOpenAgain () {
29 this.userService.updateMyProfile({ noWelcomeModal: true })
30 .subscribe(
31 () => console.log('We will not open the welcome modal again.'),
32
33 err => this.notifier.error(err.message)
34 )
35 }
36 }