mirror of https://github.com/vector-im/riot-web
Send breadcrumb updates only when they change
Fixes an issue where hovering over the breadcrumbs could cause hundreds of web requests due to updates. This also fixes https://github.com/vector-im/riot-web/issues/9390 as the update is more reliable.pull/21833/head
parent
054011f5f8
commit
bf0605cf84
|
@ -88,11 +88,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) {
|
||||
|
@ -246,6 +241,11 @@ export default class RoomBreadcrumbs extends React.Component {
|
|||
if (this.refs.scroller) {
|
||||
this.refs.scroller.moveToOrigin();
|
||||
}
|
||||
|
||||
const roomIds = rooms.map((r) => r.room.roomId);
|
||||
if (roomIds.length > 0) {
|
||||
SettingsStore.setValue("breadcrumb_rooms", null, SettingLevel.ACCOUNT, roomIds);
|
||||
}
|
||||
}
|
||||
|
||||
_viewRoom(room, index) {
|
||||
|
|
Loading…
Reference in New Issue