mirror of https://github.com/vector-im/riot-web
Replace MatrixClientPeg with access to context in SendMessageComposer
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
13afb8d4f1
commit
ab518a469f
|
@ -40,7 +40,6 @@ import {_t, _td} from '../../../languageHandler';
|
|||
import ContentMessages from '../../../ContentMessages';
|
||||
import {Key} from "../../../Keyboard";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||
import RateLimitedFunc from '../../../ratelimitedfunc';
|
||||
import {Action} from "../../../dispatcher/actions";
|
||||
|
||||
|
@ -103,10 +102,9 @@ export default class SendMessageComposer extends React.Component {
|
|||
this.model = null;
|
||||
this._editorRef = null;
|
||||
this.currentlyComposedEditorState = null;
|
||||
const cli = MatrixClientPeg.get();
|
||||
if (cli.isCryptoEnabled() && cli.isRoomEncrypted(this.props.room.roomId)) {
|
||||
if (this.context.isCryptoEnabled() && this.context.isRoomEncrypted(this.props.room.roomId)) {
|
||||
this._prepareToEncrypt = new RateLimitedFunc(() => {
|
||||
cli.prepareToEncrypt(this.props.room);
|
||||
this.context.prepareToEncrypt(this.props.room);
|
||||
}, 60000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue