Skip to content

Commit 314e14f

Browse files
committed
Add fallback for cases with missing skillcard titles
1 parent 5d343b8 commit 314e14f

File tree

1 file changed

+5
-1
lines changed
  • packages/host/app/components/matrix

1 file changed

+5
-1
lines changed

packages/host/app/components/matrix/room.gts

+5-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,11 @@ export default class Room extends Component<Signature> {
447447

448448
private get sortedSkills(): Skill[] {
449449
return [...this.skills].sort((a, b) => {
450-
return a.card.title.localeCompare(b.card.title);
450+
// Not all of the skills have a title, so we use the skillEventId as a fallback
451+
// which should be consistent.
452+
let aTitle = a.card.title || a.skillEventId;
453+
let bTitle = b.card.title || b.skillEventId;
454+
return aTitle.localeCompare(bTitle);
451455
});
452456
}
453457

0 commit comments

Comments
 (0)