Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 6766402

Browse files
authored
FIX: prevent crash in "all" filter on features page (#1505)
* FIX: prevent crash in "all" filter on features page * simplify
1 parent 1b16fc8 commit 6766402

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

assets/javascripts/discourse/components/ai-features-list.gjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ class ExpandableList extends Component {
6666

6767
export default class AiFeaturesList extends Component {
6868
get sortedModules() {
69-
if (!this.args.modules || !this.args.modules.length) {
70-
return [];
71-
}
72-
73-
return this.args.modules.toSorted((a, b) =>
74-
a.module_name.localeCompare(b.module_name)
69+
const modules = this.args.modules?.toArray() || this.args.modules;
70+
return [...(modules || [])].toSorted((a, b) =>
71+
(a.module_name || "").localeCompare(b.module_name || "")
7572
);
7673
}
7774

0 commit comments

Comments
 (0)