Correctly fill window.matrixChat even when a Wrapper module is active (#26395)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
This commit is contained in:
parent
f1a39b3e4d
commit
0040181489
4 changed files with 16 additions and 6 deletions
|
@ -65,7 +65,7 @@ function onTokenLoginCompleted(): void {
|
|||
window.history.replaceState(null, "", url.href);
|
||||
}
|
||||
|
||||
export async function loadApp(fragParams: {}): Promise<ReactElement> {
|
||||
export async function loadApp(fragParams: {}, matrixChatRef: React.Ref<MatrixChat>): Promise<ReactElement> {
|
||||
initRouting();
|
||||
const platform = PlatformPeg.get();
|
||||
|
||||
|
@ -117,6 +117,7 @@ export async function loadApp(fragParams: {}): Promise<ReactElement> {
|
|||
return (
|
||||
<wrapperOpts.Wrapper>
|
||||
<MatrixChat
|
||||
ref={matrixChatRef}
|
||||
onNewScreen={onNewScreen}
|
||||
config={config}
|
||||
realQueryParams={params}
|
||||
|
|
|
@ -30,6 +30,7 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig";
|
|||
import { setTheme } from "matrix-react-sdk/src/theme";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { ModuleRunner } from "matrix-react-sdk/src/modules/ModuleRunner";
|
||||
import MatrixChat from "matrix-react-sdk/src/components/structures/MatrixChat";
|
||||
|
||||
import ElectronPlatform from "./platform/ElectronPlatform";
|
||||
import PWAPlatform from "./platform/PWAPlatform";
|
||||
|
@ -147,7 +148,10 @@ export async function loadApp(fragParams: {}): Promise<void> {
|
|||
/* webpackPreload: true */
|
||||
"./app"
|
||||
);
|
||||
window.matrixChat = ReactDOM.render(await module.loadApp(fragParams), document.getElementById("matrixchat"));
|
||||
function setWindowMatrixChat(matrixChat: MatrixChat): void {
|
||||
window.matrixChat = matrixChat;
|
||||
}
|
||||
ReactDOM.render(await module.loadApp(fragParams, setWindowMatrixChat), document.getElementById("matrixchat"));
|
||||
}
|
||||
|
||||
export async function showError(title: string, messages?: string[]): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue