|
|
@ -11,6 +11,7 @@ import { User } from 'src/app/models/user';
|
|
|
|
styleUrls: ['./feed.component.sass']
|
|
|
|
styleUrls: ['./feed.component.sass']
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class FeedComponent implements OnInit {
|
|
|
|
export class FeedComponent implements OnInit {
|
|
|
|
|
|
|
|
loading = true;
|
|
|
|
checked: boolean; // if the "I protected the environment."-box is checked
|
|
|
|
checked: boolean; // if the "I protected the environment."-box is checked
|
|
|
|
empty: boolean;
|
|
|
|
empty: boolean;
|
|
|
|
// points value of the green action
|
|
|
|
// points value of the green action
|
|
|
@ -38,6 +39,7 @@ export class FeedComponent implements OnInit {
|
|
|
|
if (this.loggedIn) {
|
|
|
|
if (this.loggedIn) {
|
|
|
|
this.userId = user.userID;
|
|
|
|
this.userId = user.userID;
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.parentSelectedPostList = this.feedNew;
|
|
|
|
this.parentSelectedPostList = this.feedNew;
|
|
|
|
this.feedMostLiked = this.feedNew;
|
|
|
|
this.feedMostLiked = this.feedNew;
|
|
|
@ -45,6 +47,7 @@ export class FeedComponent implements OnInit {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.parentSelectedPostList = this.feedNew;
|
|
|
|
this.parentSelectedPostList = this.feedNew;
|
|
|
|
this.feedMostLiked = this.feedNew;
|
|
|
|
this.feedMostLiked = this.feedNew;
|
|
|
|