parent
f5d490ee78
commit
4da7ce10de
|
@ -269,12 +269,11 @@ export default createReactClass({
|
||||||
...favouriteRooms,
|
...favouriteRooms,
|
||||||
...dmRooms,
|
...dmRooms,
|
||||||
...recentRooms,
|
...recentRooms,
|
||||||
// eslint-disable-next-line prefer-spread
|
...[].concat.apply([], shownCustomTagRooms), // eslint-disable-line prefer-spread
|
||||||
...[].concat.apply([], shownCustomTagRooms),
|
|
||||||
...lowPriorityRooms,
|
...lowPriorityRooms,
|
||||||
...historicalRooms,
|
...historicalRooms,
|
||||||
...serverNoticeRooms,
|
...serverNoticeRooms,
|
||||||
], this.props.searchFilter); // TODO optimize
|
], this.props.searchFilter);
|
||||||
|
|
||||||
if (payload.unread) {
|
if (payload.unread) {
|
||||||
// filter to only notification rooms (and our current active room so we can index properly)
|
// filter to only notification rooms (and our current active room so we can index properly)
|
||||||
|
@ -284,9 +283,8 @@ export default createReactClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentIndex = rooms.findIndex(room => room.roomId === currentRoomId);
|
const currentIndex = rooms.findIndex(room => room.roomId === currentRoomId);
|
||||||
|
// use slice to account for looping around the start
|
||||||
const [room] = rooms.slice((currentIndex + payload.delta) % rooms.length);
|
const [room] = rooms.slice((currentIndex + payload.delta) % rooms.length);
|
||||||
// console.log("DEBUG", currentIndex, room, rooms);
|
|
||||||
if (room) {
|
if (room) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
|
|
Loading…
Reference in New Issue