From 039711b18f9f3c918b7b7d045214e0557dd98272 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Fri, 2 May 2025 08:38:37 +0200 Subject: [PATCH] feat: display uploaded video after successful upload --- frontend/src/app/components/home/home.component.html | 1 + frontend/src/app/components/home/home.component.ts | 8 ++++++++ .../home/upload-video/upload-video.component.ts | 10 +++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/home/home.component.html b/frontend/src/app/components/home/home.component.html index 952cc1e..f06f187 100644 --- a/frontend/src/app/components/home/home.component.html +++ b/frontend/src/app/components/home/home.component.html @@ -92,5 +92,6 @@ @if (uploadVideoOverview) { } diff --git a/frontend/src/app/components/home/home.component.ts b/frontend/src/app/components/home/home.component.ts index 37b0089..a6b917b 100644 --- a/frontend/src/app/components/home/home.component.ts +++ b/frontend/src/app/components/home/home.component.ts @@ -92,6 +92,14 @@ export class HomeComponent implements OnInit { } } + onVideoUploaded(video: Video) { + this.currentVideo = null; + setTimeout(() => { + this.currentVideo = video; + this.videos.push(video); + }, 1); + } + isWideScreen() { return window.innerWidth > 600; } diff --git a/frontend/src/app/components/home/upload-video/upload-video.component.ts b/frontend/src/app/components/home/upload-video/upload-video.component.ts index 2ad1044..87ec95f 100644 --- a/frontend/src/app/components/home/upload-video/upload-video.component.ts +++ b/frontend/src/app/components/home/upload-video/upload-video.component.ts @@ -5,6 +5,7 @@ import { ErrorService } from '../../../services/error.service'; import { BtnLargeComponent } from '../../../shared/components/buttons/btn-large/btn-large.component'; import { VideoService } from '../../../services/video.service'; import { LoadingDialogComponent } from '../../../shared/components/loading-dialog/loading-dialog.component'; +import { Video } from '../../../interfaces/video.interface'; @Component({ selector: 'app-upload-video', @@ -20,6 +21,7 @@ import { LoadingDialogComponent } from '../../../shared/components/loading-dialo }) export class UploadVideoComponent { @Output() toggleUploadVideoOverview = new EventEmitter(); + @Output() uploadedVideo = new EventEmitter