mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
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:
committed by
GitHub
parent
b6b9ce3c46
commit
21ffc50f1e
@@ -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