From f99d14ff45ec4e03ce261f7f5a8cccf876a94307 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 2 Feb 2021 20:17:43 +0200 Subject: Implemented loading screen in post page --- .../src/app/components/post-page/post-page.component.html | 4 +++- .../src/app/components/post-page/post-page.component.ts | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/DevHive.Angular/src/app/components/post-page/post-page.component.html b/src/DevHive.Angular/src/app/components/post-page/post-page.component.html index da9bcc9..8665865 100644 --- a/src/DevHive.Angular/src/app/components/post-page/post-page.component.html +++ b/src/DevHive.Angular/src/app/components/post-page/post-page.component.html @@ -1,4 +1,6 @@ -
+ + +
diff --git a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts index 39365d7..3991870 100644 --- a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts +++ b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts @@ -17,6 +17,7 @@ import { CloudinaryService } from 'src/app/services/cloudinary.service'; }) export class PostPageComponent implements OnInit { private _title = 'Post'; + public dataArrived = false; public loggedIn = false; public editable = false; public editingPost = false; @@ -69,8 +70,13 @@ export class PostPageComponent implements OnInit { const tmp = { name: fileURL.match('(?<=\/)(?:.(?!\/))+$')?.pop() ?? 'Attachment' }; + Object.assign(file, tmp); this.files.push(file); + + if (this.files.length === this.post.fileURLs.length) { + this.dataArrived = true; + } } ); } @@ -114,6 +120,7 @@ export class PostPageComponent implements OnInit { this.reloadPage(); } ); + this.dataArrived = false; } this.editingPost = !this.editingPost; } -- cgit v1.2.3