Fix React class constructor signature to not pass context

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-12-06 11:41:32 +00:00
parent 983db465c3
commit 62c765bfd3
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
41 changed files with 89 additions and 90 deletions

View file

@ -374,16 +374,16 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
public static contextType = SDKContext;
declare public context: React.ContextType<typeof SDKContext>;
public constructor(props: IRoomProps, context: React.ContextType<typeof SDKContext>) {
super(props, context);
public constructor(props: IRoomProps) {
super(props);
this.askToJoinEnabled = SettingsStore.getValue("feature_ask_to_join");
if (!context.client) {
if (!this.context.client) {
throw new Error("Unable to create RoomView without MatrixClient");
}
const llMembers = context.client.hasLazyLoadMembersEnabled();
const llMembers = this.context.client.hasLazyLoadMembersEnabled();
this.state = {
roomId: undefined,
roomLoading: true,
@ -417,7 +417,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
showJoinLeaves: true,
showAvatarChanges: true,
showDisplaynameChanges: true,
matrixClientIsReady: context.client?.isInitialSyncComplete(),
matrixClientIsReady: this.context.client?.isInitialSyncComplete(),
mainSplitContentType: MainSplitContentType.Timeline,
timelineRenderingType: TimelineRenderingType.Room,
liveTimeline: undefined,