diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-27 08:08:38 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-27 08:08:38 +0200 |
| commit | 1f3ce144043359d7b00178fbbb3c38163071f040 (patch) | |
| tree | d1a242e562a3ea7390b82404fe2773b9ad94c942 /src | |
| parent | 0cbe73007b9112bf7aa76e2584cb1fafc272dd5b (diff) | |
| download | DevHive-Angular-1f3ce144043359d7b00178fbbb3c38163071f040.tar DevHive-Angular-1f3ce144043359d7b00178fbbb3c38163071f040.tar.gz DevHive-Angular-1f3ce144043359d7b00178fbbb3c38163071f040.zip | |
Rating service now handles null returned ratings on init
Diffstat (limited to 'src')
| -rw-r--r-- | src/app/components/post/post.component.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts index f0d8a44..e1e593a 100644 --- a/src/app/components/post/post.component.ts +++ b/src/app/components/post/post.component.ts @@ -105,6 +105,10 @@ export class PostComponent implements OnInit, AfterViewInit { ngAfterViewInit(): void { this._ratingServe.getRatingByUserAndPostWithSessionStorageRequest(Guid.parse(this.paramId)).subscribe({ next: (x: object) => { + if (!x) { + return; + } + const isLike: boolean = Object.values(x)[3]; this.changeColorOfVoteButton(isLike, !isLike); |
