make alphabetical sort order stable
This commit is contained in:
parent
989a27395e
commit
404e6f8b87
1 changed files with 6 additions and 2 deletions
|
@ -45,8 +45,12 @@ export class RoomTileViewModel extends ViewModel {
|
|||
}
|
||||
|
||||
compare(other) {
|
||||
// sort by name for now
|
||||
return this._room.name.localeCompare(other._room.name);
|
||||
// sort alphabetically
|
||||
const nameCmp = this._room.name.localeCompare(other._room.name);
|
||||
if (nameCmp === 0) {
|
||||
return this._room.id.localeCompare(other._room.id);
|
||||
}
|
||||
return nameCmp;
|
||||
}
|
||||
|
||||
get isOpen() {
|
||||
|
|
Reference in a new issue