Both devices to update their mapping after secondary registration

pull/534/head
sachaaaaa 6 years ago
parent 4929f8d8db
commit a314721cce

@ -1,4 +1,4 @@
/* global Whisper, $, getAccountManager, textsecure, i18n, passwordUtil, _ */ /* global Whisper, $, getAccountManager, textsecure, i18n, passwordUtil, _, lokiFileServerAPI */
/* eslint-disable more/no-then */ /* eslint-disable more/no-then */
@ -137,8 +137,9 @@
const language = this.$('#mnemonic-display-language').val(); const language = this.$('#mnemonic-display-language').val();
this.showProfilePage(mnemonic, language); this.showProfilePage(mnemonic, language);
}, },
onSecondaryDeviceRegistered() { async onSecondaryDeviceRegistered() {
clearInterval(this.pairingInterval); clearInterval(this.pairingInterval);
await lokiFileServerAPI.updateOurDeviceMapping();
// Ensure the left menu is updated // Ensure the left menu is updated
Whisper.events.trigger('userChanged', { isSecondaryDevice: true }); Whisper.events.trigger('userChanged', { isSecondaryDevice: true });
this.$el.trigger('openInbox'); this.$el.trigger('openInbox');

@ -3,6 +3,7 @@
textsecure, textsecure,
libsignal, libsignal,
libloki, libloki,
lokiFileServerAPI,
mnemonic, mnemonic,
btoa, btoa,
Signal, Signal,
@ -622,6 +623,7 @@
}; };
// Update authorisation in database with the new grant signature // Update authorisation in database with the new grant signature
await libloki.storage.savePairingAuthorisation(authorisation); await libloki.storage.savePairingAuthorisation(authorisation);
await lokiFileServerAPI.updateOurDeviceMapping();
await libloki.api.sendPairingAuthorisation( await libloki.api.sendPairingAuthorisation(
authorisation, authorisation,
secondaryDevicePubKey secondaryDevicePubKey

Loading…
Cancel
Save