Skip to content

Commit

Permalink
Fixed cinny verified device failed to verify other
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed May 8, 2022
1 parent 73723ba commit 2075a57
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/organisms/emoji-verification/EmojiVerification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function EmojiVerificationContent({ data, requestClose }) {
const mountStore = useStore();

const beginVerification = async () => {
if (mx.getCrossSigningId() === null && isCrossVerified(mx.deviceId)) {
if (
isCrossVerified(mx.deviceId)
&& (mx.getCrossSigningId() === null || await mx.crypto.crossSigningInfo.isStoredInKeyCache('self_signing') === false)
) {
if (!hasPrivateKey(getDefaultSSKey())) {
const keyData = await accessSecretStorage('Emoji verification');
if (!keyData) {
Expand Down Expand Up @@ -66,18 +69,21 @@ function EmojiVerificationContent({ data, requestClose }) {
useEffect(() => {
mountStore.setItem(true);
const handleChange = () => {
if (request.done || request.cancelled) {
requestClose();
return;
}
if (targetDevice && request.started) {
beginVerification();
}
if (request.done || request.cancelled) requestClose();
};

if (request === null) return null;
const req = request;
req.on('change', handleChange);
return () => {
req.off('change', handleChange);
if (!req.cancelled && !req.done) {
if (req.cancelled === false && req.done === false) {
req.cancel();
}
};
Expand Down

0 comments on commit 2075a57

Please sign in to comment.