You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Handle cases where the user rapidly clicks between rooms
Once the user has breadcrumbs, there should always be breadcrumbs. Therefore it is safe to ignore any updates which have zero entries.
This commit is contained in:
@@ -88,7 +88,9 @@ export default class RoomBreadcrumbs extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const roomIds = rooms.map((r) => r.room.roomId);
|
const roomIds = rooms.map((r) => r.room.roomId);
|
||||||
SettingsStore.setValue("breadcrumb_rooms", null, SettingLevel.ACCOUNT, roomIds);
|
if (roomIds.length > 0) {
|
||||||
|
SettingsStore.setValue("breadcrumb_rooms", null, SettingLevel.ACCOUNT, roomIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload) {
|
onAction(payload) {
|
||||||
@@ -147,6 +149,8 @@ export default class RoomBreadcrumbs extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_loadRoomIds(roomIds) {
|
_loadRoomIds(roomIds) {
|
||||||
|
if (!roomIds || roomIds.length <= 0) return; // Skip updates with no rooms
|
||||||
|
|
||||||
// If we're here, the list changed.
|
// If we're here, the list changed.
|
||||||
const rooms = roomIds.map((r) => MatrixClientPeg.get().getRoom(r)).filter((r) => r).map((r) => {
|
const rooms = roomIds.map((r) => MatrixClientPeg.get().getRoom(r)).filter((r) => r).map((r) => {
|
||||||
const badges = this._calculateBadgesForRoom(r) || {};
|
const badges = this._calculateBadgesForRoom(r) || {};
|
||||||
|
|||||||
Reference in New Issue
Block a user