Skip to content

Commit

Permalink
Explain intention in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MidhunSureshR committed Mar 3, 2025
1 parent 2c41ade commit 9cd1f3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stores/room-list-v3/RoomListStoreV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export class RoomListStoreV3Class extends AsyncStoreWithClient<EmptyObject> {
protected async onAction(payload: ActionPayload): Promise<void> {
if (!this.matrixClient || !this.roomSkipList?.initialized) return;

/**
* For the kind of updates that we care about (represented by the cases below),
* we try to find the associated room and simply re-insert it into the
* skiplist. If the position of said room in the sorted list changed, re-inserting
* would put it in the correct place.
*/
switch (payload.action) {
case "MatrixActions.Room.receipt": {
if (readReceiptChangeIsFor(payload.event, this.matrixClient)) {
Expand Down

0 comments on commit 9cd1f3f

Please sign in to comment.