Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ab518a4

Browse files
committed
Replace MatrixClientPeg with access to context in SendMessageComposer
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 13afb8d commit ab518a4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/components/views/rooms/SendMessageComposer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {_t, _td} from '../../../languageHandler';
4040
import ContentMessages from '../../../ContentMessages';
4141
import {Key} from "../../../Keyboard";
4242
import MatrixClientContext from "../../../contexts/MatrixClientContext";
43-
import {MatrixClientPeg} from "../../../MatrixClientPeg";
4443
import RateLimitedFunc from '../../../ratelimitedfunc';
4544
import {Action} from "../../../dispatcher/actions";
4645

@@ -103,10 +102,9 @@ export default class SendMessageComposer extends React.Component {
103102
this.model = null;
104103
this._editorRef = null;
105104
this.currentlyComposedEditorState = null;
106-
const cli = MatrixClientPeg.get();
107-
if (cli.isCryptoEnabled() && cli.isRoomEncrypted(this.props.room.roomId)) {
105+
if (this.context.isCryptoEnabled() && this.context.isRoomEncrypted(this.props.room.roomId)) {
108106
this._prepareToEncrypt = new RateLimitedFunc(() => {
109-
cli.prepareToEncrypt(this.props.room);
107+
this.context.prepareToEncrypt(this.props.room);
110108
}, 60000);
111109
}
112110

0 commit comments

Comments
 (0)