add spinner while unlinking device

pull/1094/head
Audric Ackermann 5 years ago
parent 026844e40b
commit 6f8affe5c9
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1355,7 +1355,7 @@
);
});
Whisper.events.on('deviceUnpairingRequested', async pubKey => {
Whisper.events.on('deviceUnpairingRequested', async (pubKey, callback) => {
await libloki.storage.removePairingAuthorisationForSecondaryPubKey(
pubKey
);
@ -1365,6 +1365,7 @@
// Remove all traces of the device
ConversationController.deleteContact(pubKey);
Whisper.events.trigger('refreshLinkedDeviceList');
callback();
});
}

@ -211,6 +211,7 @@ export class DevicePairingDialog extends React.Component<Props, State> {
buttonColor={SessionButtonColor.Danger}
/>
</div>
<SessionSpinner loading={this.state.loading} />
</div>
</SessionModal>
);
@ -370,13 +371,19 @@ export class DevicePairingDialog extends React.Component<Props, State> {
}
private triggerUnpairDevice() {
const deviceUnpaired = () => {
window.pushToast({
title: window.i18n('deviceUnpaired'),
});
this.closeDialog();
this.setState({ loading: false });
};
this.setState({ loading: true });
window.Whisper.events.trigger(
'deviceUnpairingRequested',
this.props.pubKeyToUnpair
this.props.pubKeyToUnpair,
deviceUnpaired
);
window.pushToast({
title: window.i18n('deviceUnpaired'),
});
this.closeDialog();
}
}

@ -1086,9 +1086,7 @@ export class Message extends React.PureComponent<Props, State> {
// We parse the message later, but we still need to do an early check
// to see if the message mentions us, so we can display the entire
// message differently
const mentions = text
? text.match(window.pubkeyPattern)
: [];
const mentions = text ? text.match(window.pubkeyPattern) : [];
const mentionMe =
mentions &&
mentions.some(m => m.slice(1) === window.lokiPublicChatAPI.ourKey);

Loading…
Cancel
Save