|
|
@ -34,7 +34,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
console.log('feed got new user');
|
|
|
|
|
|
|
|
this.user = user;
|
|
|
|
this.user = user;
|
|
|
|
this.loggedIn = user.loggedIn;
|
|
|
|
this.loggedIn = user.loggedIn;
|
|
|
|
if (this.loggedIn) {
|
|
|
|
if (this.loggedIn) {
|
|
|
@ -44,7 +43,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
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;
|
|
|
|
console.log(this.feedNew);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRaw().subscribe(response => {
|
|
|
@ -52,7 +50,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
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;
|
|
|
|
console.log(this.feedNew);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -69,7 +66,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showNew() {
|
|
|
|
showNew() {
|
|
|
|
console.log('showNew()');
|
|
|
|
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.feedNew = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.parentSelectedPostList = this.feedNew; });
|
|
|
|
this.parentSelectedPostList = this.feedNew; });
|
|
|
@ -78,7 +74,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showMostLiked() {
|
|
|
|
showMostLiked() {
|
|
|
|
console.log('showMostLiked()');
|
|
|
|
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedMostLiked = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.feedMostLiked = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.parentSelectedPostList = this.feedMostLiked; });
|
|
|
|
this.parentSelectedPostList = this.feedMostLiked; });
|
|
|
@ -90,7 +85,6 @@ export class FeedComponent implements OnInit {
|
|
|
|
refresh($event) {
|
|
|
|
refresh($event) {
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
|
|
|
|
this.parentSelectedPostList = this.feedService.renderAllPosts(response.json());
|
|
|
|
this.parentSelectedPostList = this.feedService.renderAllPosts(response.json());
|
|
|
|
console.log('Refresh');
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|