]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/modal/welcome-modal.component.ts
Add ListOverflow component to prevent sub-menu overflow
[github/Chocobozzz/PeerTube.git] / client / src / app / modal / welcome-modal.component.ts
CommitLineData
43d0ea7f
C
1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { 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})
11export 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 () {
24e7916c
RK
21 this.modalService.open(this.modal, {
22 centered: true,
43d0ea7f
C
23 backdrop: 'static',
24 keyboard: false,
25 size: 'lg'
26 })
43d0ea7f
C
27 }
28
4618b686 29 doNotOpenAgain () {
43d0ea7f
C
30 this.userService.updateMyProfile({ noWelcomeModal: true })
31 .subscribe(
32 () => console.log('We will not open the welcome modal again.'),
33
34 err => this.notifier.error(err.message)
35 )
43d0ea7f
C
36 }
37}