Pass around MatrixClients instead of using MatrixClientPeg (#10984)

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
Michael Telatynski
2023-06-01 14:43:24 +01:00
committed by GitHub
co-authored by Richard van der Hoff
parent b6b9ce3c46
commit 21ffc50f1e
23 changed files with 152 additions and 135 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ export class RoomEchoChamber extends GenericEchoChamber<RoomEchoContext, CachedR
CachedRoomKey.NotificationVolume,
v,
async (): Promise<void> => {
return setRoomNotifsState(this.context.room.roomId, v);
return setRoomNotifsState(this.context.room.client, this.context.room.roomId, v);
},
implicitlyReverted,
);
+5 -2
View File
@@ -35,6 +35,7 @@ import { ActionPayload } from "../../dispatcher/payloads";
import { Action } from "../../dispatcher/actions";
import { ActiveRoomChangedPayload } from "../../dispatcher/payloads/ActiveRoomChangedPayload";
import { SdkContextClass } from "../../contexts/SDKContext";
import { MatrixClientPeg } from "../../MatrixClientPeg";
/**
* A class for tracking the state of the right panel between layouts and
@@ -308,7 +309,9 @@ export default class RightPanelStore extends ReadyWatchingStore {
if (card.phase === RightPanelPhases.RoomMemberInfo && card.state) {
// RightPanelPhases.RoomMemberInfo -> needs to be changed to RightPanelPhases.EncryptionPanel if there is a pending verification request
const { member } = card.state;
const pendingRequest = member ? pendingVerificationRequestForUser(member) : undefined;
const pendingRequest = member
? pendingVerificationRequestForUser(MatrixClientPeg.get(), member)
: undefined;
if (pendingRequest) {
return {
phase: RightPanelPhases.EncryptionPanel,
@@ -341,7 +344,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
if (!this.currentCard?.state) return;
const { member } = this.currentCard.state;
if (!member) return;
const pendingRequest = pendingVerificationRequestForUser(member);
const pendingRequest = pendingVerificationRequestForUser(MatrixClientPeg.get(), member);
if (pendingRequest) {
this.currentCard.state.verificationRequest = pendingRequest;
this.emitAndUpdateSettings();