mirror of https://github.com/vector-im/riot-web
Merge pull request #4369 from matrix-org/bwindels/fixresetkeys
Ensure UI is updated when cross-signing gets disabledpull/21833/head
commit
c1dcb690b3
|
@ -50,6 +50,7 @@ export default class DeviceListener {
|
||||||
MatrixClientPeg.get().on('crypto.devicesUpdated', this._onDevicesUpdated);
|
MatrixClientPeg.get().on('crypto.devicesUpdated', this._onDevicesUpdated);
|
||||||
MatrixClientPeg.get().on('deviceVerificationChanged', this._onDeviceVerificationChanged);
|
MatrixClientPeg.get().on('deviceVerificationChanged', this._onDeviceVerificationChanged);
|
||||||
MatrixClientPeg.get().on('userTrustStatusChanged', this._onUserTrustStatusChanged);
|
MatrixClientPeg.get().on('userTrustStatusChanged', this._onUserTrustStatusChanged);
|
||||||
|
MatrixClientPeg.get().on('crossSigning.keysChanged', this._onCrossSingingKeysChanged);
|
||||||
MatrixClientPeg.get().on('accountData', this._onAccountData);
|
MatrixClientPeg.get().on('accountData', this._onAccountData);
|
||||||
this._recheck();
|
this._recheck();
|
||||||
}
|
}
|
||||||
|
@ -59,6 +60,7 @@ export default class DeviceListener {
|
||||||
MatrixClientPeg.get().removeListener('crypto.devicesUpdated', this._onDevicesUpdated);
|
MatrixClientPeg.get().removeListener('crypto.devicesUpdated', this._onDevicesUpdated);
|
||||||
MatrixClientPeg.get().removeListener('deviceVerificationChanged', this._onDeviceVerificationChanged);
|
MatrixClientPeg.get().removeListener('deviceVerificationChanged', this._onDeviceVerificationChanged);
|
||||||
MatrixClientPeg.get().removeListener('userTrustStatusChanged', this._onUserTrustStatusChanged);
|
MatrixClientPeg.get().removeListener('userTrustStatusChanged', this._onUserTrustStatusChanged);
|
||||||
|
MatrixClientPeg.get().removeListener('crossSigning.keysChanged', this._onCrossSingingKeysChanged);
|
||||||
MatrixClientPeg.get().removeListener('accountData', this._onAccountData);
|
MatrixClientPeg.get().removeListener('accountData', this._onAccountData);
|
||||||
}
|
}
|
||||||
this._dismissed.clear();
|
this._dismissed.clear();
|
||||||
|
@ -89,6 +91,10 @@ export default class DeviceListener {
|
||||||
this._recheck();
|
this._recheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onCrossSingingKeysChanged = () => {
|
||||||
|
this._recheck();
|
||||||
|
}
|
||||||
|
|
||||||
_onAccountData = (ev) => {
|
_onAccountData = (ev) => {
|
||||||
// User may have:
|
// User may have:
|
||||||
// * migrated SSSS to symmetric
|
// * migrated SSSS to symmetric
|
||||||
|
|
|
@ -182,6 +182,7 @@ export default createReactClass({
|
||||||
this.context.on("crypto.keyBackupStatus", this.onKeyBackupStatus);
|
this.context.on("crypto.keyBackupStatus", this.onKeyBackupStatus);
|
||||||
this.context.on("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
this.context.on("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
||||||
this.context.on("userTrustStatusChanged", this.onUserVerificationChanged);
|
this.context.on("userTrustStatusChanged", this.onUserVerificationChanged);
|
||||||
|
this.context.on("crossSigning.keysChanged", this.onCrossSigningKeysChanged);
|
||||||
// Start listening for RoomViewStore updates
|
// Start listening for RoomViewStore updates
|
||||||
this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate);
|
this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate);
|
||||||
this._rightPanelStoreToken = RightPanelStore.getSharedInstance().addListener(this._onRightPanelStoreUpdate);
|
this._rightPanelStoreToken = RightPanelStore.getSharedInstance().addListener(this._onRightPanelStoreUpdate);
|
||||||
|
@ -504,6 +505,7 @@ export default createReactClass({
|
||||||
this.context.removeListener("crypto.keyBackupStatus", this.onKeyBackupStatus);
|
this.context.removeListener("crypto.keyBackupStatus", this.onKeyBackupStatus);
|
||||||
this.context.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
this.context.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged);
|
||||||
this.context.removeListener("userTrustStatusChanged", this.onUserVerificationChanged);
|
this.context.removeListener("userTrustStatusChanged", this.onUserVerificationChanged);
|
||||||
|
this.context.removeListener("crossSigning.keysChanged", this.onCrossSigningKeysChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.removeEventListener('beforeunload', this.onPageUnload);
|
window.removeEventListener('beforeunload', this.onPageUnload);
|
||||||
|
@ -805,6 +807,13 @@ export default createReactClass({
|
||||||
this._updateE2EStatus(room);
|
this._updateE2EStatus(room);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCrossSigningKeysChanged: function() {
|
||||||
|
const room = this.state.room;
|
||||||
|
if (room) {
|
||||||
|
this._updateE2EStatus(room);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_updateE2EStatus: async function(room) {
|
_updateE2EStatus: async function(room) {
|
||||||
if (!this.context.isRoomEncrypted(room.roomId)) {
|
if (!this.context.isRoomEncrypted(room.roomId)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -130,6 +130,10 @@ export default createReactClass({
|
||||||
this._updateE2eStatus();
|
this._updateE2eStatus();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCrossSigningKeysChanged: function() {
|
||||||
|
this._updateE2eStatus();
|
||||||
|
},
|
||||||
|
|
||||||
onRoomTimeline: function(ev, room) {
|
onRoomTimeline: function(ev, room) {
|
||||||
if (!room) return;
|
if (!room) return;
|
||||||
if (room.roomId != this.props.room.roomId) return;
|
if (room.roomId != this.props.room.roomId) return;
|
||||||
|
@ -142,7 +146,7 @@ export default createReactClass({
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
cli.on("RoomState.members", this.onRoomStateMember);
|
cli.on("RoomState.members", this.onRoomStateMember);
|
||||||
cli.on("userTrustStatusChanged", this.onUserVerificationChanged);
|
cli.on("userTrustStatusChanged", this.onUserVerificationChanged);
|
||||||
|
cli.on("crossSigning.keysChanged", this.onCrossSigningKeysChanged);
|
||||||
this._updateE2eStatus();
|
this._updateE2eStatus();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -267,6 +271,7 @@ export default createReactClass({
|
||||||
cli.removeListener("RoomState.events", this.onJoinRule);
|
cli.removeListener("RoomState.events", this.onJoinRule);
|
||||||
cli.removeListener("RoomState.members", this.onRoomStateMember);
|
cli.removeListener("RoomState.members", this.onRoomStateMember);
|
||||||
cli.removeListener("userTrustStatusChanged", this.onUserVerificationChanged);
|
cli.removeListener("userTrustStatusChanged", this.onUserVerificationChanged);
|
||||||
|
cli.removeListener("crossSigning.keysChanged", this.onCrossSigningKeysChanged);
|
||||||
cli.removeListener("Room.timeline", this.onRoomTimeline);
|
cli.removeListener("Room.timeline", this.onRoomTimeline);
|
||||||
}
|
}
|
||||||
ActiveRoomObserver.removeListener(this.props.room.roomId, this._onActiveRoomChange);
|
ActiveRoomObserver.removeListener(this.props.room.roomId, this._onActiveRoomChange);
|
||||||
|
|
Loading…
Reference in New Issue