You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
No need to set options in WillStartClient
We can set them any time up to that point
This commit is contained in:
@@ -42,8 +42,9 @@ class MatrixClientPeg {
|
||||
this.matrixClient = null;
|
||||
|
||||
// These are the default options used when Lifecycle.js
|
||||
// starts the client. These can be altered when the
|
||||
// 'will_start_client' event is dispatched.
|
||||
// starts the client. These can be altered at any
|
||||
// time up to after the 'will_start_client' event is
|
||||
// finished processing.
|
||||
this.opts = {
|
||||
initialSyncLimit: 20,
|
||||
};
|
||||
|
||||
@@ -146,6 +146,10 @@ module.exports = React.createClass({
|
||||
// whilst logged in as a guest user (so they can change
|
||||
// their mind & log back in)
|
||||
this.guestCreds = null;
|
||||
|
||||
if (this.props.config.sync_timeline_limit) {
|
||||
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
|
||||
}
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
@@ -601,15 +605,11 @@ module.exports = React.createClass({
|
||||
|
||||
/**
|
||||
* Called just before the matrix client is started
|
||||
* (useful for setting options and listeners)
|
||||
* (useful for setting listeners)
|
||||
*/
|
||||
_onWillStartClient() {
|
||||
var cli = MatrixClientPeg.get();
|
||||
|
||||
if (this.props.config.sync_timeline_limit) {
|
||||
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
cli.on('sync', function(state, prevState) {
|
||||
self.updateFavicon(state, prevState);
|
||||
|
||||
Reference in New Issue
Block a user