Skip to content

Commit

Permalink
changed maxRoomsOpen (#12949)
Browse files Browse the repository at this point in the history
Allow users/developers to change the max number of rooms opened using `localStorage` its temporary and if results in some benefit we gonna remove and develop changes based on that data

<!-- INSTRUCTION: Your Pull Request name should start with one of the following tags -->
<!-- [NEW] For new features -->
<!-- [FIX] For bug fixes -->
<!-- [BREAK] For pull requests including breaking changes -->

<!-- INSTRUCTION: Inform the issue number that this PR closes, or remove the line below -->


<!-- INSTRUCTION: Link to a https://github.com/RocketChat/docs PR with added/updated documentation or an update to the missing/outdated documentation list, see https://rocket.chat/docs/contributing/documentation/  -->

<!-- INSTRUCTION: Tell us more about your PR with screen shots if you can -->
  • Loading branch information
ggazzo committed Dec 14, 2018
1 parent e6d9375 commit a69a310
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/rocketchat-ui/client/lib/RoomManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { Template } from 'meteor/templating';
import _ from 'underscore';
import { upsertMessage } from './RoomHistoryManager';


const maxRoomsOpen = parseInt(localStorage && localStorage.getItem('rc-maxRoomsOpen')) || 5 ;

const onDeleteMessageStream = (msg) => ChatMessage.remove({ _id: msg._id });
const onDeleteMessageBulkStream = ({ rid, ts, excludePinned, users }) => {
const query = { rid, ts };
Expand Down Expand Up @@ -135,7 +138,6 @@ RoomManager = new function() { //eslint-disable-line


closeOlderRooms() {
const maxRoomsOpen = 10;
if (Object.keys(openedRooms).length <= maxRoomsOpen) {
return;
}
Expand Down

0 comments on commit a69a310

Please sign in to comment.