Revert "remove unnessary manual focussing of composer"

This reverts commit 57abbc4273.
This commit is contained in:
Bruno Windels 2019-07-23 09:13:51 +02:00
parent e3ffdf1dff
commit ceb53dc0bb
5 changed files with 22 additions and 0 deletions

View file

@ -268,6 +268,8 @@ export default React.createClass({
componentDidMount: function() {
this.dispatcherRef = dis.register(this.onAction);
this.focusComposer = false;
// this can technically be done anywhere but doing this here keeps all
// the routing url path logic together.
if (this.onAliasClick) {
@ -360,6 +362,10 @@ export default React.createClass({
const durationMs = this.stopPageChangeTimer();
Analytics.trackPageChange(durationMs);
}
if (this.focusComposer) {
dis.dispatch({action: 'focus_composer'});
this.focusComposer = false;
}
},
startPageChangeTimer() {
@ -787,6 +793,8 @@ export default React.createClass({
// that has been passed out-of-band (eg.
// room name and avatar from an invite email)
_viewRoom: function(roomInfo) {
this.focusComposer = true;
const newState = {
view: VIEWS.LOGGED_IN,
currentRoomId: roomInfo.room_id || null,
@ -1360,6 +1368,7 @@ export default React.createClass({
self.firstSyncComplete = true;
self.firstSyncPromise.resolve();
dis.dispatch({action: 'focus_composer'});
self.setState({
ready: true,
showNotifierToolbar: Notifier.shouldShowToolbar(),

View file

@ -135,10 +135,12 @@ module.exports = React.createClass({
_onResendAllClick: function() {
Resend.resendUnsentEvents(this.props.room);
dis.dispatch({action: 'focus_composer'});
},
_onCancelAllClick: function() {
Resend.cancelUnsentEvents(this.props.room);
dis.dispatch({action: 'focus_composer'});
},
_onShowDevicesClick: function() {