aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DevHive.Angular/src/app/components/post-page/post-page.component.html4
-rw-r--r--src/DevHive.Angular/src/app/components/post-page/post-page.component.ts7
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;
}