Don't try loading -ve room indices

This commit is contained in:
David Baker 2015-08-14 15:44:21 +01:00
parent 87feb6b076
commit 960a38fe43

View File

@ -166,7 +166,7 @@ module.exports = {
break; break;
} }
} }
roomIndex = (roomIndex + roomIndexDelta) % allRooms.length; roomIndex = Math.max((roomIndex + roomIndexDelta) % allRooms.length, 0);
this.focusComposer = true; this.focusComposer = true;
this.setState({ this.setState({
currentRoom: allRooms[roomIndex].roomId currentRoom: allRooms[roomIndex].roomId