diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index fca185c..308c0d3 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -14,22 +14,23 @@ -

- I protected the environment. + I protected the environment.

What did you do? - + nothing ;) @@ -38,7 +39,8 @@ {{getErrorMessage()}} - diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass index 49b8a82..e3724a0 100644 --- a/src/app/components/feed/feed.component.sass +++ b/src/app/components/feed/feed.component.sass @@ -49,6 +49,8 @@ text-align: center max-height: 512px margin-bottom: 1em +#progress-bar + margin-top: 1em #action-chooser width: 100% diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index d226149..f32a8f4 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -22,6 +22,7 @@ export class FeedComponent implements OnInit { private file; fileType; public localFileUrl; + posting = false; checked = false; // if the "I protected the environment."-box is checked view = 'new'; @@ -70,7 +71,9 @@ export class FeedComponent implements OnInit { */ createPost(postElement, activityId: string) { if (postElement && activityId && this.checked) { + this.posting = true; this.feedService.createPostActivity(postElement.value, activityId, this.file).subscribe(() => { + this.posting = false; postElement.value = ''; this.textInputValue = ''; this.checked = false; @@ -81,11 +84,14 @@ export class FeedComponent implements OnInit { this.showNew(); } }, (error: IErrorResponse) => { + this.posting = false; this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; }); } else if (postElement) { + this.posting = true; this.feedService.createPost(postElement.value, this.file).subscribe(() => { + this.posting = false; postElement.value = ''; this.textInputValue = ''; this.checked = false; @@ -96,6 +102,7 @@ export class FeedComponent implements OnInit { this.showNew(); } }, (error: IErrorResponse) => { + this.posting = false; this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; }); @@ -119,7 +126,7 @@ export class FeedComponent implements OnInit { } /** - * Fetches the next posts when scrolled + * Fetches the next posts when scrolled down */ onScroll() { this.feedService.getNextPosts();