This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/components/views/elements Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ import {throttle} from "lodash";
2121import ResizeObserver from 'resize-observer-polyfill' ;
2222
2323import dis from '../../../dispatcher/dispatcher' ;
24+ import MatrixClientContext from "../../../contexts/MatrixClientContext" ;
25+ import { MatrixClientPeg } from "../../../MatrixClientPeg" ;
2426
2527// Shamelessly ripped off Modal.js. There's probably a better way
2628// of doing reusable widgets like dialog boxes & menus where we go and
@@ -144,9 +146,11 @@ export default class PersistedElement extends React.Component {
144146 }
145147
146148 renderApp ( ) {
147- const content = < div ref = { this . collectChild } style = { this . props . style } >
148- { this . props . children }
149- </ div > ;
149+ const content = < MatrixClientContext . Provider value = { MatrixClientPeg . get ( ) } >
150+ < div ref = { this . collectChild } style = { this . props . style } >
151+ { this . props . children }
152+ </ div >
153+ </ MatrixClientContext . Provider > ;
150154
151155 ReactDOM . render ( content , getOrCreateContainer ( 'mx_persistedElement_' + this . props . persistKey ) ) ;
152156 }
You can’t perform that action at this time.
0 commit comments