ActivityPub-federated video streaming platform using P2P directly in your web browser
Put presentation logic in the components
Chocobozzz9bfe96e19f55
diff --git a/client/app/videos/video-add/video-add.component.ts b/client/app/videos/video-add/video-add.component.tsindex b11475ae9f..eb10aedeb2 100644--- a/client/app/videos/video-add/video-add.component.ts+++ b/client/app/videos/video-add/video-add.component.ts@@ -25,9 +25,9 @@ export class VideoAddComponent implements OnInit {private form: any;constructor(- private router: Router,+ private authService: AuthService,private elementRef: ElementRef,- private authService: AuthService+ private router: Router) {}ngOnInit() {@@ -62,8 +62,8 @@ export class VideoAddComponent implements OnInit {}uploadFile() {- this.form.headers = this.authService.getRequestHeader().toJSON();this.form.formData = jQuery(this.elementRef.nativeElement).find('form').serializeArray();+ this.form.headers = this.authService.getRequestHeader().toJSON();this.form.submit();}}diff --git a/client/app/videos/video-list/video-list.component.html b/client/app/videos/video-list/video-list.component.htmlindex edbbaf3aea..80b1e7b1b0 100644--- a/client/app/videos/video-list/video-list.component.html+++ b/client/app/videos/video-list/video-list.component.html@@ -6,7 +6,7 @@<div class="videos-miniatures"><my-loader [loading]="loading"></my-loader>- <div class="col-md-12 no-video" *ngIf="!loading && videos.length === 0">There is no video.</div>+ <div class="col-md-12 no-video" *ngIf="noVideo()">There is no video.</div><my-video-miniature *ngFor="let video of videos" [video]="video" [user]="user" (removed)="onRemoved(video)"></my-video-miniature>diff --git a/client/app/videos/video-list/video-list.component.ts b/client/app/videos/video-list/video-list.component.tsindex 23b97df32f..1315786810 100644--- a/client/app/videos/video-list/video-list.component.ts+++ b/client/app/videos/video-list/video-list.component.ts@@ -80,6 +80,10 @@ export class VideoListComponent implements OnInit {);}+ noVideo() {+ return !this.loading && this.videos.length === 0;+ }+onRemoved(video: Video) {this.videos.splice(this.videos.indexOf(video), 1);}