diff --git a/src/app/components/chatmanager/chatmanager.component.ts b/src/app/components/chatmanager/chatmanager.component.ts index 45216f2..ffed815 100644 --- a/src/app/components/chatmanager/chatmanager.component.ts +++ b/src/app/components/chatmanager/chatmanager.component.ts @@ -51,7 +51,6 @@ export class ChatmanagerComponent implements OnInit { refresh() { this.chatService.getAllChatsRaw() .subscribe(response => { - console.log(response); this.parentChats = this.chatService.renderAllChats(response.json()); }); } diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 05dbcdf..1ceb1d9 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -39,7 +39,6 @@ export class FeedComponent implements OnInit { } ngOnInit() { - console.log('init feedcomponent'); this.data.currentUserInfo.subscribe(user => { this.user = user; this.loggedIn = user.loggedIn; @@ -67,7 +66,10 @@ export class FeedComponent implements OnInit { this.feedService.createPostActivity(postElement.value, activityId).subscribe(() => { postElement.value = ''; this.textInputValue = ''; - this.view = 'new'; + this.checked = false; + if (this.view !== 'new') { + this.showNew(); + } }, (error: IErrorResponse) => { this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; @@ -76,7 +78,10 @@ export class FeedComponent implements OnInit { this.feedService.createPost(postElement.value).subscribe(() => { postElement.value = ''; this.textInputValue = ''; - this.view = 'new'; + this.checked = false; + if (this.view !== 'new') { + this.showNew(); + } }, (error: IErrorResponse) => { this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; @@ -95,6 +100,7 @@ export class FeedComponent implements OnInit { * Shows the feed sorted by new */ showNew() { + this.view = 'new'; this.feedService.getPosts(Sort.NEW); } @@ -102,6 +108,7 @@ export class FeedComponent implements OnInit { * Shows the feed sorted by top */ showMostLiked() { + this.view = 'mostliked'; this.feedService.getPosts(Sort.TOP); } diff --git a/src/app/components/group/group.component.ts b/src/app/components/group/group.component.ts index de4ad53..76d6f9f 100644 --- a/src/app/components/group/group.component.ts +++ b/src/app/components/group/group.component.ts @@ -32,8 +32,6 @@ export class DialogCreateEventComponent { name = name.trim(); if (name && date && time) { date = date + ' ' + time; - console.log(date); - console.log(new Date(date).getTime().toString()); this.group.createEvent(name, (new Date(date)).getTime().toString(), this.groupId); this.dialogRef.close(); } @@ -69,7 +67,6 @@ export class GroupComponent implements OnInit { const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); if (this.id !== possibleID && this.id && this.router.url.includes('group/')) { // reload the group - console.log('search for group id: ' + this.router.url.substr(this.router.url.lastIndexOf('/') + 1)); this.ngOnInit(); } } diff --git a/src/app/components/main-navigation/main-navigation.component.ts b/src/app/components/main-navigation/main-navigation.component.ts index 4e67c2b..14a60de 100644 --- a/src/app/components/main-navigation/main-navigation.component.ts +++ b/src/app/components/main-navigation/main-navigation.component.ts @@ -121,7 +121,6 @@ export class MainNavigationComponent implements OnInit { }` }; this.http.post(url, body).subscribe(response => { - console.log(response.text()); }); this.loggedIn = false; const user = new User(); @@ -131,12 +130,10 @@ export class MainNavigationComponent implements OnInit { } acceptRequest(id: number) { - console.log('try to accept request from id: ' + id); const headers = new Headers(); headers.set('Content-Type', 'application/json'); this.http.post(environment.graphQLUrl, this.requestservice.buildJsonAcceptRequest(id)) .subscribe(response => { - console.log(response); for (let i = 0; i < this.user.receivedRequests.length; i++) { if (this.user.receivedRequests[i].senderUserID === id) { this.user.receivedRequests.splice(i, 1); @@ -151,7 +148,6 @@ export class MainNavigationComponent implements OnInit { headers.set('Content-Type', 'application/json'); this.http.post(environment.graphQLUrl, this.requestservice.buildJsonDenyRequest(id)) .subscribe(response => { - console.log(response); for (let i = 0; i < this.user.receivedRequests.length; i++) { if (this.user.receivedRequests[i].senderUserID === id) { this.user.receivedRequests.splice(i, 1); diff --git a/src/app/components/profile/fileUpload/fileUpload.component.ts b/src/app/components/profile/fileUpload/fileUpload.component.ts index b4b5bf0..2e1c24d 100644 --- a/src/app/components/profile/fileUpload/fileUpload.component.ts +++ b/src/app/components/profile/fileUpload/fileUpload.component.ts @@ -54,7 +54,7 @@ export class DialogFileUploadComponent { }, (error) => { this.uploading = false; this.errorOccurred = true; - console.log(error); + console.error(error); if (error.error) { this.errorMessage = error.error.error; } else { diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 147c1b7..41b8e57 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -60,7 +60,6 @@ export class ProfileComponent implements OnInit { this.userProfile = response; // tslint:disable-next-line:max-line-length this.userProfile.allowedToSendRequest = this.requestService.isAllowedToSendRequest(this.userProfile.userID, this.self); - console.log(this.userProfile.allowedToSendRequest); this.ownProfile = this.userProfile.userID === this.self.userID; this.rankname = this.levellist.getLevelName(this.userProfile.level); } else { diff --git a/src/app/components/search/search.component.ts b/src/app/components/search/search.component.ts index 732371e..bc379ea 100644 --- a/src/app/components/search/search.component.ts +++ b/src/app/components/search/search.component.ts @@ -44,8 +44,6 @@ export class SearchComponent implements OnInit { if (this.category === 'user') { this.loading = true; this.findUser(searchWord); - } else if (this.category === 'groupe') { - console.log('search group'); } } } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 0b86821..89659bb 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -163,7 +163,7 @@ export class FeedService extends BaseService { .pipe(tap(response => { if (this.activePostList === Sort.NEW) { const updatedPosts = this.posts.getValue(); - updatedPosts.push(this.constructPost(response)); + updatedPosts.unshift(this.constructPost(response)); this.posts.next(updatedPosts); } })); diff --git a/src/app/services/register/register.service.ts b/src/app/services/register/register.service.ts index 6eb16af..2eac62a 100644 --- a/src/app/services/register/register.service.ts +++ b/src/app/services/register/register.service.ts @@ -26,7 +26,6 @@ export class RegisterService { return this.http.post(url, this.buildJson(registration)) .subscribe(response => { - console.log(response.text()); this.registerSuccess(); this.updateUserInfo(response.json()); }, errorCb @@ -34,8 +33,6 @@ export class RegisterService { } public registerSuccess() { - console.log('alles supi dupi'); - // do routing this.router.navigateByUrl(''); } diff --git a/src/app/services/settings/settings.service.ts b/src/app/services/settings/settings.service.ts index 00c590f..1e14f03 100644 --- a/src/app/services/settings/settings.service.ts +++ b/src/app/services/settings/settings.service.ts @@ -20,9 +20,7 @@ export class SettingsService { const headers = new Headers(); headers.set('Content-Type', 'application/json'); const body = this.buildJsonDarkMode('darkmode: ' + '\'' + active + '\''); - this.http.post(url, body).subscribe(response => { - console.log(response.text()); - }); + this.http.post(url, body).subscribe(); } public buildJsonDarkMode(setting_: string): any {