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( await libloki.storage.removePairingAuthorisationForSecondaryPubKey(
pubKey pubKey
); );
@ -1365,6 +1365,7 @@
// Remove all traces of the device // Remove all traces of the device
ConversationController.deleteContact(pubKey); ConversationController.deleteContact(pubKey);
Whisper.events.trigger('refreshLinkedDeviceList'); Whisper.events.trigger('refreshLinkedDeviceList');
callback();
}); });
} }

@ -211,6 +211,7 @@ export class DevicePairingDialog extends React.Component<Props, State> {
buttonColor={SessionButtonColor.Danger} buttonColor={SessionButtonColor.Danger}
/> />
</div> </div>
<SessionSpinner loading={this.state.loading} />
</div> </div>
</SessionModal> </SessionModal>
); );
@ -370,13 +371,19 @@ export class DevicePairingDialog extends React.Component<Props, State> {
} }
private triggerUnpairDevice() { private triggerUnpairDevice() {
const deviceUnpaired = () => {
window.pushToast({
title: window.i18n('deviceUnpaired'),
});
this.closeDialog();
this.setState({ loading: false });
};
this.setState({ loading: true });
window.Whisper.events.trigger( window.Whisper.events.trigger(
'deviceUnpairingRequested', '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 // 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 // to see if the message mentions us, so we can display the entire
// message differently // message differently
const mentions = text const mentions = text ? text.match(window.pubkeyPattern) : [];
? text.match(window.pubkeyPattern)
: [];
const mentionMe = const mentionMe =
mentions && mentions &&
mentions.some(m => m.slice(1) === window.lokiPublicChatAPI.ourKey); mentions.some(m => m.slice(1) === window.lokiPublicChatAPI.ourKey);

Loading…
Cancel
Save