mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
Use unified function to check cross-signing is ready
Fixes mismatches where the Cross signing panel would say cross signing was not ready but no toasts would appear. Fixes https://github.com/vector-im/riot-web/issues/12796 Fixes https://github.com/vector-im/riot-web/issues/12798 Requires https://github.com/matrix-org/matrix-js-sdk/pull/1279
This commit is contained in:
parent
b8ef736038
commit
281bc09c9a
@ -107,7 +107,10 @@ export default class DeviceListener {
|
|||||||
) return;
|
) return;
|
||||||
|
|
||||||
if (!cli.isCryptoEnabled()) return;
|
if (!cli.isCryptoEnabled()) return;
|
||||||
if (!cli.getCrossSigningId()) {
|
|
||||||
|
const crossSigningReady = await cli.crossSigningReady();
|
||||||
|
|
||||||
|
if (!crossSigningReady) {
|
||||||
if (this._dismissedThisDeviceToast) {
|
if (this._dismissedThisDeviceToast) {
|
||||||
ToastStore.sharedInstance().dismissToast(THIS_DEVICE_TOAST_KEY);
|
ToastStore.sharedInstance().dismissToast(THIS_DEVICE_TOAST_KEY);
|
||||||
return;
|
return;
|
||||||
|
@ -74,12 +74,14 @@ export default class CrossSigningPanel extends React.PureComponent {
|
|||||||
const secretStorageKeyInAccount = await secretStorage.hasKey();
|
const secretStorageKeyInAccount = await secretStorage.hasKey();
|
||||||
const homeserverSupportsCrossSigning =
|
const homeserverSupportsCrossSigning =
|
||||||
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing");
|
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing");
|
||||||
|
const crossSigningReady = await cli.crossSigningReady();
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
crossSigningPublicKeysOnDevice,
|
crossSigningPublicKeysOnDevice,
|
||||||
crossSigningPrivateKeysInStorage,
|
crossSigningPrivateKeysInStorage,
|
||||||
secretStorageKeyInAccount,
|
secretStorageKeyInAccount,
|
||||||
homeserverSupportsCrossSigning,
|
homeserverSupportsCrossSigning,
|
||||||
|
crossSigningReady,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,6 +126,7 @@ export default class CrossSigningPanel extends React.PureComponent {
|
|||||||
crossSigningPrivateKeysInStorage,
|
crossSigningPrivateKeysInStorage,
|
||||||
secretStorageKeyInAccount,
|
secretStorageKeyInAccount,
|
||||||
homeserverSupportsCrossSigning,
|
homeserverSupportsCrossSigning,
|
||||||
|
crossSigningReady,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
let errorSection;
|
let errorSection;
|
||||||
@ -139,11 +142,14 @@ export default class CrossSigningPanel extends React.PureComponent {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let summarisedStatus;
|
let summarisedStatus;
|
||||||
if (!homeserverSupportsCrossSigning) {
|
if (homeserverSupportsCrossSigning === undefined) {
|
||||||
|
const InlineSpinner = sdk.getComponent('views.elements.InlineSpinner');
|
||||||
|
summarisedStatus = <p><InlineSpinner /></p>;
|
||||||
|
} else if (!homeserverSupportsCrossSigning) {
|
||||||
summarisedStatus = <p>{_t(
|
summarisedStatus = <p>{_t(
|
||||||
"Your homeserver does not support cross-signing.",
|
"Your homeserver does not support cross-signing.",
|
||||||
)}</p>;
|
)}</p>;
|
||||||
} else if (enabledForAccount && crossSigningPublicKeysOnDevice) {
|
} else if (crossSigningReady) {
|
||||||
summarisedStatus = <p>✅ {_t(
|
summarisedStatus = <p>✅ {_t(
|
||||||
"Cross-signing and secret storage are enabled.",
|
"Cross-signing and secret storage are enabled.",
|
||||||
)}</p>;
|
)}</p>;
|
||||||
|
Loading…
Reference in New Issue
Block a user