This commit is contained in:
Guilherme Gazzo 2017-11-19 02:10:29 -02:00
parent d4d031e2e7
commit 6436c00162
3 changed files with 6 additions and 5 deletions

View File

@ -18,7 +18,9 @@ const settingsSchema = {
_server: 'servers', _server: 'servers',
valueAsString: { type: 'string', optional: true }, valueAsString: { type: 'string', optional: true },
valueAsBoolean: { type: 'bool', optional: true }, valueAsBoolean: { type: 'bool', optional: true },
valueAsNumber: { type: 'int', optional: true } valueAsNumber: { type: 'int', optional: true },
_updatedAt: { type: 'date', optional: true }
} }
}; };

View File

@ -145,7 +145,7 @@ const handleForgotPasswordRequest = function* handleForgotPasswordRequest({ emai
}; };
const root = function* root() { const root = function* root() {
yield takeEvery(types.SERVER.CHANGED, handleLoginWhenServerChanges); yield takeLatest(types.SERVER.CHANGED, handleLoginWhenServerChanges);
yield takeLatest(types.LOGIN.REQUEST, handleLoginRequest); yield takeLatest(types.LOGIN.REQUEST, handleLoginRequest);
yield takeLatest(types.LOGIN.SUCCESS, saveToken); yield takeLatest(types.LOGIN.SUCCESS, saveToken);
yield takeLatest(types.LOGIN.SUBMIT, handleLoginSubmit); yield takeLatest(types.LOGIN.SUBMIT, handleLoginSubmit);

View File

@ -86,7 +86,7 @@ export default class RoomView extends React.Component {
.sorted('ts', true); .sorted('ts', true);
this.state = { this.state = {
slow: false, slow: false,
dataSource: ds.cloneWithRows(this.data), dataSource: ds.cloneWithRows([]),
loaded: true, loaded: true,
joined: typeof props.rid === 'undefined' joined: typeof props.rid === 'undefined'
}; };
@ -102,10 +102,9 @@ export default class RoomView extends React.Component {
this.timer = setTimeout(() => this.setState({ slow: true }), 5000); this.timer = setTimeout(() => this.setState({ slow: true }), 5000);
this.props.getMessages(this.rid); this.props.getMessages(this.rid);
this.data.addListener(this.updateState); this.data.addListener(this.updateState);
this.state.dataSource = ds.cloneWithRows(this.data);
} }
componentDidMount() { componentDidMount() {
this.updateState();
} }
componentDidUpdate() { componentDidUpdate() {
return !this.props.loading && clearTimeout(this.timer); return !this.props.loading && clearTimeout(this.timer);