@@ -30,7 +30,6 @@ import SettingsStore from "../../settings/SettingsStore";
3030import { SettingLevel } from "../../settings/SettingLevel" ;
3131import ResizeHandle from "../views/elements/ResizeHandle" ;
3232import { CollapseDistributor , Resizer } from "../../resizer" ;
33- import type ResizeNotifier from "../../utils/ResizeNotifier" ;
3433import PlatformPeg from "../../PlatformPeg" ;
3534import { DefaultTagID } from "../../stores/room-list/models" ;
3635import { hideToast as hideServerLimitToast , showToast as showServerLimitToast } from "../../toasts/ServerLimitToast" ;
@@ -67,6 +66,7 @@ import { monitorSyncedPushRules } from "../../utils/pushRules/monitorSyncedPushR
6766import { type ConfigOptions } from "../../SdkConfig" ;
6867import { MatrixClientContextProvider } from "./MatrixClientContextProvider" ;
6968import { Landmark , LandmarkNavigation } from "../../accessibility/LandmarkNavigation" ;
69+ import { SDKContext } from "../../contexts/SDKContext.ts" ;
7070
7171// We need to fetch each pinned message individually (if we don't already have it)
7272// so each pinned message may trigger a request. Limit the number per room for sanity.
@@ -86,7 +86,6 @@ interface IProps {
8686 // transitioned to PWLU)
8787 onRegistered : ( credentials : IMatrixClientCreds ) => Promise < MatrixClient > ;
8888 hideToSRUsers : boolean ;
89- resizeNotifier : ResizeNotifier ;
9089 // eslint-disable-next-line camelcase
9190 page_type ?: string ;
9291 autoJoin ?: boolean ;
@@ -134,8 +133,11 @@ class LoggedInView extends React.Component<IProps, IState> {
134133 protected timezoneProfileUpdateRef ?: string [ ] ;
135134 protected resizer ?: Resizer < ICollapseConfig , CollapseItem > ;
136135
137- public constructor ( props : IProps ) {
138- super ( props ) ;
136+ public static contextType = SDKContext ;
137+ declare public context : React . ContextType < typeof SDKContext > ;
138+
139+ public constructor ( props : IProps , context : React . ContextType < typeof SDKContext > ) {
140+ super ( props , context ) ;
139141
140142 this . state = {
141143 syncErrorData : undefined ,
@@ -281,15 +283,15 @@ class LoggedInView extends React.Component<IProps, IState> {
281283 } ,
282284 onResized : ( size ) => {
283285 panelSize = size ;
284- this . props . resizeNotifier . notifyLeftHandleResized ( ) ;
286+ this . context . resizeNotifier . notifyLeftHandleResized ( ) ;
285287 } ,
286288 onResizeStart : ( ) => {
287- this . props . resizeNotifier . startResizing ( ) ;
289+ this . context . resizeNotifier . startResizing ( ) ;
288290 } ,
289291 onResizeStop : ( ) => {
290292 // Always save the lhs size for the new room list.
291293 if ( useNewRoomList || ! panelCollapsed ) window . localStorage . setItem ( "mx_lhs_size" , "" + panelSize ) ;
292- this . props . resizeNotifier . stopResizing ( ) ;
294+ this . context . resizeNotifier . stopResizing ( ) ;
293295 } ,
294296 isItemCollapsed : ( domNode ) => {
295297 // New rooms list does not support collapsing.
@@ -681,7 +683,6 @@ class LoggedInView extends React.Component<IProps, IState> {
681683 threepidInvite = { this . props . threepidInvite }
682684 oobData = { this . props . roomOobData }
683685 key = { this . props . currentRoomId || "roomview" }
684- resizeNotifier = { this . props . resizeNotifier }
685686 justCreatedOpts = { this . props . roomJustCreatedOpts }
686687 forceTimeline = { this . props . forceTimeline }
687688 />
@@ -695,7 +696,7 @@ class LoggedInView extends React.Component<IProps, IState> {
695696 case PageTypes . UserView :
696697 if ( ! ! this . props . currentUserId ) {
697698 pageElement = (
698- < UserView userId = { this . props . currentUserId } resizeNotifier = { this . props . resizeNotifier } />
699+ < UserView userId = { this . props . currentUserId } resizeNotifier = { this . context . resizeNotifier } />
699700 ) ;
700701 }
701702 break ;
@@ -748,7 +749,7 @@ class LoggedInView extends React.Component<IProps, IState> {
748749 < LeftPanel
749750 pageType = { this . props . page_type as PageTypes }
750751 isMinimized = { shouldUseMinimizedUI || false }
751- resizeNotifier = { this . props . resizeNotifier }
752+ resizeNotifier = { this . context . resizeNotifier }
752753 />
753754 </ div >
754755 </ div >
0 commit comments