Fix CPU spin on joining rooms
Ratelimit roomheader's updates and move some other things into rate limited functions.
This commit is contained in:
parent
f56aff7cb9
commit
a2eb0a9cf0
2 changed files with 11 additions and 7 deletions
|
@ -21,6 +21,7 @@ var sdk = require('../../../index');
|
|||
var MatrixClientPeg = require('../../../MatrixClientPeg');
|
||||
var Modal = require("../../../Modal");
|
||||
var dis = require("../../../dispatcher");
|
||||
var rate_limited_func = require('../../../ratelimitedfunc');
|
||||
|
||||
var linkify = require('linkifyjs');
|
||||
var linkifyElement = require('linkifyjs/element');
|
||||
|
@ -85,9 +86,13 @@ module.exports = React.createClass({
|
|||
}
|
||||
|
||||
// redisplay the room name, topic, etc.
|
||||
this.forceUpdate();
|
||||
this._rateLimitedUpdate();
|
||||
},
|
||||
|
||||
_rateLimitedUpdate: new rate_limited_func(function() {
|
||||
this.forceUpdate();
|
||||
}, 500),
|
||||
|
||||
_onRoomNameChange: function(room) {
|
||||
this.forceUpdate();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue