This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ import { TagWatcher } from "./TagWatcher";
30
30
import RoomViewStore from "../RoomViewStore" ;
31
31
import { Algorithm , LIST_UPDATED_EVENT } from "./algorithms/Algorithm" ;
32
32
import { EffectiveMembership , getEffectiveMembership } from "./membership" ;
33
- import { ListLayout } from "./ListLayout" ;
34
33
import { isNullOrUndefined } from "matrix-js-sdk/src/utils" ;
35
34
import RoomListLayoutStore from "./RoomListLayoutStore" ;
36
35
import { MarkedExecution } from "../../utils/MarkedExecution" ;
@@ -425,7 +424,8 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
425
424
426
425
// logic must match calculateListOrder
427
426
private calculateTagSorting ( tagId : TagID ) : SortAlgorithm {
428
- const defaultSort = SortAlgorithm . Alphabetic ;
427
+ const isDefaultRecent = tagId === DefaultTagID . Invite || tagId === DefaultTagID . DM ;
428
+ const defaultSort = isDefaultRecent ? SortAlgorithm . Recent : SortAlgorithm . Alphabetic ;
429
429
const settingAlphabetical = SettingsStore . getValue ( "RoomList.orderAlphabetically" , null , true ) ;
430
430
const definedSort = this . getTagSorting ( tagId ) ;
431
431
const storedSort = this . getStoredTagSorting ( tagId ) ;
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ export class RecentAlgorithm implements IAlgorithm {
38
38
// actually changed (probably needs to be done higher up?) then we could do an
39
39
// insertion sort or similar on the limited set of changes.
40
40
41
- const myUserId = MatrixClientPeg . get ( ) . getUserId ( ) ;
41
+ // TODO: Don't assume we're using the same client as the peg
42
+ let myUserId = '' ;
43
+ if ( MatrixClientPeg . get ( ) ) {
44
+ myUserId = MatrixClientPeg . get ( ) . getUserId ( ) ;
45
+ }
42
46
43
47
const tsCache : { [ roomId : string ] : number } = { } ;
44
48
const getLastTs = ( r : Room ) => {
@@ -68,7 +72,6 @@ export class RecentAlgorithm implements IAlgorithm {
68
72
const ev = r . timeline [ i ] ;
69
73
if ( ! ev . getTs ( ) ) continue ; // skip events that don't have timestamps (tests only?)
70
74
71
- // TODO: Don't assume we're using the same client as the peg
72
75
if ( ev . getSender ( ) === myUserId || Unread . eventTriggersUnreadCount ( ev ) ) {
73
76
return ev . getTs ( ) ;
74
77
}
You can’t perform that action at this time.
0 commit comments