import { Component, ElementRef, ViewChild } from '@angular/core'
import { VideoDetails } from '../../../shared/video/video-details.model'
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { Notifier } from '@app/core'
resolutionId: number | string = -1
video: VideoDetails
+ activeModal: NgbActiveModal
constructor (
private notifier: Notifier,
show (video: VideoDetails) {
this.video = video
- const m = this.modalService.open(this.modal)
- m.result.then(() => this.onClose())
- .catch(() => this.onClose())
+ this.activeModal = this.modalService.open(this.modal)
this.resolutionId = this.video.files[0].resolution.id
}
download () {
window.location.assign(this.getLink())
+ this.activeModal.close()
}
getLink () {