Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2894 from matrix-org/travis/breadcrumbs/ratelimit
Browse files Browse the repository at this point in the history
Send breadcrumb updates only when they change
  • Loading branch information
turt2live authored Apr 9, 2019
2 parents 44e33ba + 43362bf commit daaedb8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/views/rooms/RoomBreadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ export default class RoomBreadcrumbs extends React.Component {
setTimeout(() => this.setState({rooms}), 0);
}
}

const roomIds = rooms.map((r) => r.room.roomId);
if (roomIds.length > 0) {
SettingsStore.setValue("breadcrumb_rooms", null, SettingLevel.ACCOUNT, roomIds);
}
}

onAction(payload) {
Expand Down Expand Up @@ -252,6 +247,14 @@ export default class RoomBreadcrumbs extends React.Component {
if (this.refs.scroller) {
this.refs.scroller.moveToOrigin();
}

// We don't track room aesthetics (badges, membership, etc) over the wire so we
// don't need to do this elsewhere in the file. Just where we alter the room IDs
// and their order.
const roomIds = rooms.map((r) => r.room.roomId);
if (roomIds.length > 0) {
SettingsStore.setValue("breadcrumb_rooms", null, SettingLevel.ACCOUNT, roomIds);
}
}

_viewRoom(room, index) {
Expand Down

0 comments on commit daaedb8

Please sign in to comment.