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:
co-authored by
Richard van der Hoff
parent
b6b9ce3c46
commit
21ffc50f1e
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user