From 454917efdd46265bfec13a98a7a2b560ee7d403b Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 18:28:54 +0100 Subject: [PATCH] Change error clearing to occur on input change --- src/app/components/feed/feed.component.html | 2 +- src/app/components/feed/feed.component.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index dac9442..c8339e5 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -7,7 +7,7 @@ infinite-scroll - + diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index ff21e52..599c45e 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -49,9 +49,6 @@ export class FeedComponent implements OnInit { }); this.feedService.getPosts('NEW'); this.feedService.posts.subscribe(response => { - if (response.length > 0) { - // this.loading = false; - } this.parentSelectedPostList = response; }); this.feedService.newPostsAvailable.subscribe(response => { @@ -104,4 +101,14 @@ export class FeedComponent implements OnInit { getErrorMessage() { return this.errorMessage; } + + /** + * Executed when the text in the input field changes. + */ + private onTextInputChange() { + if (this.errorOccurred) { + this.errorOccurred = false; + this.errorMessage = ''; + } + } }