You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-04 11:51:45 +03:00
Use updated waitFor API with well-known
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
|||||||
} from "./toasts/UnverifiedSessionToast";
|
} from "./toasts/UnverifiedSessionToast";
|
||||||
import { privateShouldBeEncrypted } from "./createRoom";
|
import { privateShouldBeEncrypted } from "./createRoom";
|
||||||
import { isSecretStorageBeingAccessed, accessSecretStorage } from "./CrossSigningManager";
|
import { isSecretStorageBeingAccessed, accessSecretStorage } from "./CrossSigningManager";
|
||||||
import { ensureClientWellKnown, isSecureBackupRequired } from './utils/WellKnownUtils';
|
import { isSecureBackupRequired } from './utils/WellKnownUtils';
|
||||||
import { isLoggedIn } from './components/structures/MatrixChat';
|
import { isLoggedIn } from './components/structures/MatrixChat';
|
||||||
|
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ export default class DeviceListener {
|
|||||||
showSetupEncryptionToast(SetupKind.UPGRADE_ENCRYPTION);
|
showSetupEncryptionToast(SetupKind.UPGRADE_ENCRYPTION);
|
||||||
} else {
|
} else {
|
||||||
// No cross-signing or key backup on account (set up encryption)
|
// No cross-signing or key backup on account (set up encryption)
|
||||||
await ensureClientWellKnown();
|
await cli.waitForClientWellKnown();
|
||||||
if (isSecureBackupRequired() && isLoggedIn()) {
|
if (isSecureBackupRequired() && isLoggedIn()) {
|
||||||
// If we're meant to set up, and Secure Backup is required,
|
// If we're meant to set up, and Secure Backup is required,
|
||||||
// trigger the flow directly without a toast once logged in.
|
// trigger the flow directly without a toast once logged in.
|
||||||
|
|||||||
@@ -23,14 +23,6 @@ export interface IE2EEWellKnown {
|
|||||||
default?: boolean;
|
default?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function ensureClientWellKnown() {
|
|
||||||
const cli = MatrixClientPeg.get();
|
|
||||||
if (cli.haveAttemptedFetchingClientWellKnown()) return;
|
|
||||||
return new Promise(resolve => {
|
|
||||||
cli.once("WellKnown.attempted", resolve);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getE2EEWellKnown(): IE2EEWellKnown {
|
export function getE2EEWellKnown(): IE2EEWellKnown {
|
||||||
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
||||||
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {
|
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user