Skip to content

Commit

Permalink
Merge branch 'master' into 7391-improve-chatapi-error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Dec 26, 2023
2 parents 09e1ea5 + 6c2b4d6 commit 498aa0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/chat/chat-sidebar/chat-sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<ng-container *ngIf="filteredConversations?.length; else noChats">
<ul>
<li *ngFor="let conversation of filteredConversations.reverse(); let i = index" (click)="selectConversation(conversation)">
<li *ngFor="let conversation of filteredConversations; let i = index" (click)="selectConversation(conversation)">
<ng-container *ngIf="isEditing; else notEditing">
<ng-container *ngIf="selectedConversation?._id === conversation?._id; else conversationTitle">
<form [formGroup]="titleForm[conversation?._id]" (ngSubmit)="submitTitle(conversation)">
Expand Down
9 changes: 7 additions & 2 deletions src/app/chat/chat-sidebar/chat-sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ export class ChatSidebarComponent implements OnInit, OnDestroy {

getChatHistory() {
this.chatService.findConversations([], [ this.userService.get().name ]).subscribe(
(conversations) => {
this.conversations = conversations;
(conversations: any) => {
this.conversations = conversations.sort((a, b) => {
const dateA = a.updatedDate || a.createdDate;
const dateB = b.updatedDate || b.createdDate;

return dateB - dateA;
});
this.filteredConversations = [ ...conversations ];
this.initializeFormGroups();
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/community/community.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ <h3 style="text-align: right; margin-right: 0.5rem;">
<mat-tab i18n-label label="Reports">
<planet-teams-reports [reports]="reports" [editable]="isCommunityLeader && !planetCode" [team]="team" (reportsChanged)="dataChanged()"></planet-teams-reports>
</mat-tab>
<mat-tab i18n-label label="Calendar" *ngIf="deviceType === deviceTypes.MOBILE">
<mat-tab i18n-label label="Calendar" *ngIf="deviceType !== deviceTypes.DESKTOP">
<planet-calendar [resizeCalendar]="resizeCalendar" [link]="{ teams: teamId }" [sync]="{ type: 'sync', planetCode: planetCode || configuration.code }"></planet-calendar>
</mat-tab>
</mat-tab-group>
</div>
<planet-calendar *ngIf="deviceType != deviceTypes.MOBILE" [link]="{ teams: teamId }" [sync]="{ type: 'sync', planetCode: planetCode || configuration.code }"></planet-calendar>
<planet-calendar *ngIf="deviceType === deviceTypes.DESKTOP" [link]="{ teams: teamId }" [sync]="{ type: 'sync', planetCode: planetCode || configuration.code }"></planet-calendar>
</div>
</div>

0 comments on commit 498aa0e

Please sign in to comment.