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:
parent
b6b9ce3c46
commit
21ffc50f1e
23 changed files with 152 additions and 135 deletions
|
@ -67,7 +67,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
if (roomId && getConfigLivestreamUrl() && WidgetType.JITSI.matches(app.type)) {
|
||||
const onStreamAudioClick = async (): Promise<void> => {
|
||||
try {
|
||||
await startJitsiAudioLivestream(widgetMessaging!, roomId);
|
||||
await startJitsiAudioLivestream(cli, widgetMessaging!, roomId);
|
||||
} catch (err) {
|
||||
logger.error("Failed to start livestream", err);
|
||||
// XXX: won't i18n well, but looks like widget api only support 'message'?
|
||||
|
|
|
@ -191,7 +191,7 @@ export function DeviceItem({ userId, device }: { userId: string; device: IDevice
|
|||
const onDeviceClick = (): void => {
|
||||
const user = cli.getUser(userId);
|
||||
if (user) {
|
||||
verifyDevice(user, device);
|
||||
verifyDevice(cli, user, device);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1446,9 +1446,9 @@ const BasicUserInfo: React.FC<{
|
|||
className="mx_UserInfo_field mx_UserInfo_verifyButton"
|
||||
onClick={() => {
|
||||
if (hasCrossSigningKeys) {
|
||||
verifyUser(member as User);
|
||||
verifyUser(cli, member as User);
|
||||
} else {
|
||||
legacyVerifyUser(member as User);
|
||||
legacyVerifyUser(cli, member as User);
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -61,6 +61,7 @@ import SettingsSubsection, { SettingsSubsectionText } from "../../shared/Setting
|
|||
import { SettingsSubsectionHeading } from "../../shared/SettingsSubsectionHeading";
|
||||
import Heading from "../../../typography/Heading";
|
||||
import InlineSpinner from "../../../elements/InlineSpinner";
|
||||
import MatrixClientContext from "../../../../../contexts/MatrixClientContext";
|
||||
|
||||
interface IProps {
|
||||
closeSettingsFn: () => void;
|
||||
|
@ -96,6 +97,9 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class GeneralUserSettingsTab extends React.Component<IProps, IState> {
|
||||
public static contextType = MatrixClientContext;
|
||||
public context!: React.ContextType<typeof MatrixClientContext>;
|
||||
|
||||
private readonly dispatcherRef: string;
|
||||
|
||||
public constructor(props: IProps) {
|
||||
|
@ -217,6 +221,7 @@ export default class GeneralUserSettingsTab extends React.Component<IProps, ISta
|
|||
try {
|
||||
const idAccessToken = await authClient.getAccessToken({ check: false });
|
||||
await startTermsFlow(
|
||||
this.context,
|
||||
[new Service(SERVICE_TYPES.IS, idServerUrl, idAccessToken!)],
|
||||
(policiesAndServices, agreedUrls, extraClassNames) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue