mirror of https://github.com/vector-im/riot-web
disable editor history/persistence when in grid to avoid pesky bug
parent
f593bff3c3
commit
c8243357ea
|
@ -1690,6 +1690,7 @@ module.exports = React.createClass({
|
|||
<MessageComposer
|
||||
roomViewStore={this.props.roomViewStore}
|
||||
room={this.state.room}
|
||||
isGrid={this.props.isGrid}
|
||||
onResize={this.onChildResize}
|
||||
uploadFile={this.uploadFile}
|
||||
callState={this.state.callState}
|
||||
|
|
|
@ -359,6 +359,7 @@ export default class MessageComposer extends React.Component {
|
|||
roomViewStore={this.props.roomViewStore}
|
||||
ref={(c) => this.messageComposerInput = c}
|
||||
key="controls_input"
|
||||
isGrid={this.props.isGrid}
|
||||
onResize={this.props.onResize}
|
||||
room={this.props.room}
|
||||
placeholder={placeholderText}
|
||||
|
|
|
@ -132,6 +132,18 @@ function rangeEquals(a: Range, b: Range): boolean {
|
|||
&& a.isBackward === b.isBackward);
|
||||
}
|
||||
|
||||
class NoopHistoryManager {
|
||||
getItem() {}
|
||||
save() {}
|
||||
|
||||
get currentIndex() { return 0; }
|
||||
set currentIndex(_) {}
|
||||
|
||||
get history() { return []; }
|
||||
set history(_) {}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The textInput part of the MessageComposer
|
||||
*/
|
||||
|
@ -343,8 +355,15 @@ export default class MessageComposerInput extends React.Component {
|
|||
|
||||
componentWillMount() {
|
||||
this.dispatcherRef = this.props.roomViewStore.getDispatcher().register(this.onAction);
|
||||
if (this.props.isGrid) {
|
||||
|
||||
|
||||
|
||||
this.historyManager = new NoopHistoryManager();
|
||||
} else {
|
||||
this.historyManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_');
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.roomViewStore.getDispatcher().unregister(this.dispatcherRef);
|
||||
|
|
Loading…
Reference in New Issue