From 9575b819d55ea102a6776532584d09e5818e33c3 Mon Sep 17 00:00:00 2001 From: Asli Aykan <56061820+asliayk@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:31:10 +0200 Subject: [PATCH] Communication: Fix sidebar refresh issue after channel deletion (#9271) --- .../course-conversations.component.html | 2 +- .../course-conversations.component.ts | 16 +++++++--------- .../conversation-header.component.ts | 2 ++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/app/overview/course-conversations/course-conversations.component.html b/src/main/webapp/app/overview/course-conversations/course-conversations.component.html index 52cf58d80242..9979347728ec 100644 --- a/src/main/webapp/app/overview/course-conversations/course-conversations.component.html +++ b/src/main/webapp/app/overview/course-conversations/course-conversations.component.html @@ -42,7 +42,7 @@ }
@if (activeConversation) { - + { + this.sidebarConversations = this.courseOverviewService.mapConversationsToSidebarCardElements(this.conversationsOfUser); + this.accordionConversationGroups = this.courseOverviewService.groupConversationsByChannelType(this.conversationsOfUser, this.messagingEnabled); + this.updateSidebarData(); + }, + }); } updateSidebarData() { @@ -308,9 +312,6 @@ export class CourseConversationsComponent implements OnInit, OnDestroy { .subscribe((chatPartners: UserPublicInfoDTO[]) => { this.metisConversationService.createGroupChat(chatPartners?.map((partner) => partner.login!)).subscribe({ complete: () => { - this.metisConversationService.forceRefresh().subscribe({ - complete: () => {}, - }); this.prepareSidebarData(); }, }); @@ -330,9 +331,6 @@ export class CourseConversationsComponent implements OnInit, OnDestroy { if (chatPartner?.login) { this.metisConversationService.createOneToOneChat(chatPartner.login).subscribe({ complete: () => { - this.metisConversationService.forceRefresh().subscribe({ - complete: () => {}, - }); this.prepareSidebarData(); }, }); diff --git a/src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts b/src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts index 15b5744fc734..2bf7adf1ebae 100644 --- a/src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts +++ b/src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts @@ -27,6 +27,7 @@ export class ConversationHeaderComponent implements OnInit, OnDestroy { private ngUnsubscribe = new Subject(); @Output() collapseSearch = new EventEmitter(); + @Output() onUpdateSidebar = new EventEmitter(); INFO = ConversationDetailTabs.INFO; MEMBERS = ConversationDetailTabs.MEMBERS; @@ -107,6 +108,7 @@ export class ConversationHeaderComponent implements OnInit, OnDestroy { this.metisConversationService.forceRefresh().subscribe({ complete: () => {}, }); + this.onUpdateSidebar.emit(); }); }