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
emit resize event when banners are shown/hidden to restore scroll pos
This commit is contained in:
@@ -29,6 +29,7 @@ import PlatformPeg from "../../PlatformPeg";
|
||||
import SdkConfig from "../../SdkConfig";
|
||||
import * as RoomListSorter from "../../RoomListSorter";
|
||||
import dis from "../../dispatcher";
|
||||
import Notifier from '../../Notifier';
|
||||
|
||||
import Modal from "../../Modal";
|
||||
import Tinter from "../../Tinter";
|
||||
@@ -196,6 +197,7 @@ export default React.createClass({
|
||||
|
||||
syncError: null, // If the current syncing status is ERROR, the error object, otherwise null.
|
||||
resizeNotifier: new ResizeNotifier(),
|
||||
showNotifierToolbar: Notifier.shouldShowToolbar(),
|
||||
};
|
||||
return s;
|
||||
},
|
||||
@@ -644,8 +646,9 @@ export default React.createClass({
|
||||
case 'view_invite':
|
||||
showRoomInviteDialog(payload.roomId);
|
||||
break;
|
||||
case 'notifier_enabled':
|
||||
this.forceUpdate();
|
||||
case 'notifier_enabled': {
|
||||
this.setState({showNotifierToolbar: Notifier.shouldShowToolbar()});
|
||||
}
|
||||
break;
|
||||
case 'hide_left_panel':
|
||||
this.setState({
|
||||
@@ -1180,6 +1183,7 @@ export default React.createClass({
|
||||
*/
|
||||
_onLoggedIn: async function() {
|
||||
this.setStateForNewView({view: VIEWS.LOGGED_IN});
|
||||
this.setState({showNotifierToolbar: Notifier.shouldShowToolbar()});
|
||||
if (this._is_registered) {
|
||||
this._is_registered = false;
|
||||
|
||||
@@ -1672,7 +1676,10 @@ export default React.createClass({
|
||||
},
|
||||
|
||||
_dispatchTimelineResize() {
|
||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
||||
// prevent dispatch from within dispatch error
|
||||
setTimeout(() => {
|
||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
||||
}, 0);
|
||||
},
|
||||
|
||||
onRoomCreated: function(roomId) {
|
||||
|
||||
Reference in New Issue
Block a user