diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index cf32c8a6609dd8748f39047ab79fa18aae82c3e7..a03d29cdc3a6db94236dc8ff38fa6337c6b07651 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -35,14 +35,14 @@ <mat-menu #sortMenu="matMenu" xPosition="before"> <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(votedesc)"> - <mat-icon>arrow_upwards</mat-icon> + <mat-icon>keyboard_arrow_up</mat-icon> </button> <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(voteasc)"> - <mat-icon>arrow_downwards</mat-icon> + <mat-icon>keyboard_arrow_down</mat-icon> </button> - <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(currentSort === timedesc ? timeasc : timedesc)"> + <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(time)"> <mat-icon>access_time</mat-icon> </button> </mat-menu> diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index dae81293fac8310a2d82d2e7f253fe17e77b9be6..8e313d94a7a67b689545947e39214cca79101c40 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -31,8 +31,7 @@ export class CommentListComponent implements OnInit { isLoading = true; voteasc = 'vote_asc'; votedesc = 'vote_desc'; - timeasc = 'time_asc'; - timedesc = 'time_desc'; + time = 'time'; currentSort = this.votedesc; read = 'read'; unread = 'unread'; @@ -205,9 +204,7 @@ export class CommentListComponent implements OnInit { return b.score - a.score; } const dateA = new Date(a.timestamp), dateB = new Date(b.timestamp); - if (type === this.timedesc) { - return +dateA - +dateB; - } else { + if (type === this.time) { return +dateB - +dateA; } });