X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fvideo-actions-dropdown.component.ts;h=c1da0eba6e37920459d71c7ca77f22585d70dee2;hb=72675ebe0181ab2389fb2f75a3b2acdca6e09c07;hp=b2d77a9e675fab722c507ef7c4b455c8b85465e0;hpb=722bca907b6aa69c3b617221870451ccf436921a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index b2d77a9e6..c1da0eba6 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts @@ -1,4 +1,4 @@ -import { AfterContentInit, AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' +import { AfterViewInit, Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' import { I18n } from '@ngx-translate/i18n-polyfill' import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' @@ -133,6 +133,10 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges { return this.video.isUnblacklistableBy(this.user) } + isVideoDownloadable () { + return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled + } + /* Action handlers */ async unblacklistVideo () { @@ -202,7 +206,7 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges { { label: this.i18n('Download'), handler: () => this.showDownloadModal(), - isDisplayed: () => this.displayOptions.download, + isDisplayed: () => this.displayOptions.download && this.isVideoDownloadable(), iconName: 'download' }, {