diff --git a/src/app/components/main-navigation/main-navigation.component.ts b/src/app/components/main-navigation/main-navigation.component.ts index 8141ae8..a3243a3 100644 --- a/src/app/components/main-navigation/main-navigation.component.ts +++ b/src/app/components/main-navigation/main-navigation.component.ts @@ -65,7 +65,8 @@ export class MainNavigationComponent implements OnInit { if (this.user.darkmode === true && this.lighttheme) { this.toggleTheme(); this.darkModeButtonChecked = true; - } else if (this.user.loggedIn && !this.user.darkmode && !this.lighttheme) { // IF user activated darkmode and logged in after that + // IF user activated darkmode and logged in after that + } else if (this.user.loggedIn && !this.user.darkmode && !this.lighttheme) { this.settingsService.setDarkModeActive(true); } this.updateLinks(); diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index c9fa936..77dbab9 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -63,8 +63,7 @@ export class ProfileComponent implements OnInit { } else { this.profileService.getUserData(this.id); } - this.profileService.proflile.subscribe(response => - { + this.profileService.proflile.subscribe(response => { if (response) { this.userProfile = response; // tslint:disable-next-line:max-line-length diff --git a/src/app/services/profile/profile.service.ts b/src/app/services/profile/profile.service.ts index 428d0cb..ecd1986 100644 --- a/src/app/services/profile/profile.service.ts +++ b/src/app/services/profile/profile.service.ts @@ -11,16 +11,16 @@ import { Observable, Subject } from 'rxjs'; }) export class ProfileService { - public proflile:Subject = new Subject(); + public proflile: Subject = new Subject(); constructor(private http: Http) { } public getUserData(userId: string) { const headers = new Headers(); headers.set('Content-Type', 'application/json'); - //return this.renderProfile(this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId))); + // return this.renderProfile(this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId))); this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId)).subscribe(result => { - //push onto subject + // push onto subject this.proflile.next(this.renderProfile(result.json())); return this.proflile; }); @@ -29,9 +29,9 @@ export class ProfileService { public getUserDataBySelfId(userId: string, selfId: string) { const headers = new Headers(); headers.set('Content-Type', 'application/json'); - //return this.renderProfile(this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId))); + // return this.renderProfile(this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId))); this.http.post(environment.graphQLUrl, this.buildGetProfileJsonBySelfId(userId, selfId)).subscribe(result => { - //push onto subject + // push onto subject this.proflile.next(this.renderProfile(result.json())); return this.proflile; }); @@ -134,9 +134,9 @@ export class ProfileService { const userVote: string = post.userVote; const deletable: boolean = post.deletable; const author = new Author(post.author.id, post.author.name, post.author.handle); - const temp = new Date(Number(post.createdAt)); - const date = temp.toLocaleString('en-GB'); - posts.push(new Post(id, content, htmlContent, upvotes, downvotes, userVote, deletable, date, author)); + const ptemp = new Date(Number(post.createdAt)); + const pdate = ptemp.toLocaleString('en-GB'); + posts.push(new Post(id, content, htmlContent, upvotes, downvotes, userVote, deletable, pdate, author)); } profile.posts = posts; console.log(profile); diff --git a/src/app/services/search/search.service.ts b/src/app/services/search/search.service.ts index 05afd6b..9269dcb 100644 --- a/src/app/services/search/search.service.ts +++ b/src/app/services/search/search.service.ts @@ -33,7 +33,7 @@ export class SearchService { public renderGroups(pResponse: any): Array { const groups = new Array(); - for (const group of pResponse.data.search.groups) { + for (const group of pResponse.data.search.groups) { groups.push(new GroupInfo(group.id, group.name)); } return groups;