diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-02 20:17:43 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-02 20:17:43 +0200 |
| commit | f99d14ff45ec4e03ce261f7f5a8cccf876a94307 (patch) | |
| tree | f8a6401e7c55a18b2734827de72f4f871beb42b5 /src/DevHive.Angular | |
| parent | ab63ab8d0099bae3b454886abc4ef4150d84d4e9 (diff) | |
| download | DevHive-f99d14ff45ec4e03ce261f7f5a8cccf876a94307.tar DevHive-f99d14ff45ec4e03ce261f7f5a8cccf876a94307.tar.gz DevHive-f99d14ff45ec4e03ce261f7f5a8cccf876a94307.zip | |
Implemented loading screen in post page
Diffstat (limited to 'src/DevHive.Angular')
| -rw-r--r-- | src/DevHive.Angular/src/app/components/post-page/post-page.component.html | 4 | ||||
| -rw-r--r-- | src/DevHive.Angular/src/app/components/post-page/post-page.component.ts | 7 |
2 files changed, 10 insertions, 1 deletions
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 @@ -<div id="content"> +<app-loading *ngIf="!dataArrived"></app-loading> + +<div id="content" *ngIf="dataArrived"> <div class="many-buttons" *ngIf="loggedIn"> <button class="submit-btn" type="submit" (click)="backToFeed()">ᐊ Back to feed</button> <button class="submit-btn" type="submit" (click)="backToProfile()">ᐊ Back to profile</button> 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; } |
