mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Sort feed list alphabetically in bot command response (#791)
* Sort feed list alphabetically in bot command response Fixes GH-790 * Changelog * Linting --------- Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
This commit is contained in:
parent
4351a37131
commit
1c54506f6e
1
changelog.d/791.misc
Normal file
1
changelog.d/791.misc
Normal file
@ -0,0 +1 @@
|
||||
Sort feed list alphabetically in bot command response
|
@ -290,7 +290,9 @@ export class SetupConnection extends CommandConnection {
|
||||
if (feeds.length === 0) {
|
||||
return this.client.sendHtmlNotice(this.roomId, md.renderInline('Not subscribed to any feeds'));
|
||||
} else {
|
||||
const feedDescriptions = feeds.map(feed => {
|
||||
const feedDescriptions = feeds.sort(
|
||||
(a, b) => (a.label ?? a.url).localeCompare(b.label ?? b.url)
|
||||
).map(feed => {
|
||||
if (feed.label) {
|
||||
return `[${feed.label}](${feed.url})`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user