diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts index 471f50fb..c0e496dc 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts @@ -79,21 +79,22 @@ export class ExpansionPanelComponent @Input() set favoritBuddyList(userInfoList: UserInfo[]) { if (!userInfoList || 0 === userInfoList.length) { - return; - } - const groupNode: GroupNode = { - nodeType: NodeType.Favorit, - children: [] - }; - - userInfoList.forEach(userInfo => { - groupNode.children.push({ + this.favoritNodes = []; + } else { + const groupNode: GroupNode = { nodeType: NodeType.Favorit, - userInfo - }); - }); + children: [] + }; - this.favoritNodes = [groupNode]; + userInfoList.forEach(userInfo => { + groupNode.children.push({ + nodeType: NodeType.Favorit, + userInfo + }); + }); + + this.favoritNodes = [groupNode]; + } this.refreshRootNodeList(); }