fix link device. start polling for our pubkey

pull/1781/head
audric 4 years ago
parent 151dcd1431
commit 41c2ce67a7

@ -23,7 +23,7 @@
try { try {
latestVersionWithV = await window.Fsv2.getLatestDesktopReleaseFileToFsV2(); latestVersionWithV = await window.Fsv2.getLatestDesktopReleaseFileToFsV2();
if (!latestVersionWithV) { if (!latestVersionWithV) {
throw new Error('Invalid latest version. Shceduling retry...'); throw new Error('Invalid latest version. Scheduling retry...');
} }
const latestVer = semver.clean(latestVersionWithV); const latestVer = semver.clean(latestVersionWithV);
if (semver.valid(latestVer)) { if (semver.valid(latestVer)) {

@ -17,6 +17,7 @@ import {
import { fromHex } from '../../../session/utils/String'; import { fromHex } from '../../../session/utils/String';
import { TaskTimedOutError } from '../../../session/utils/Promise'; import { TaskTimedOutError } from '../../../session/utils/Promise';
import { mn_decode } from '../../../session/crypto/mnemonic'; import { mn_decode } from '../../../session/crypto/mnemonic';
import { SwarmPolling } from '../../../session/snode_api/swarmPolling';
export const MAX_USERNAME_LENGTH = 20; export const MAX_USERNAME_LENGTH = 20;
// tslint:disable: use-simple-attributes // tslint:disable: use-simple-attributes
@ -190,9 +191,11 @@ export async function signInWithLinking(signInDetails: {
try { try {
await resetRegistration(); await resetRegistration();
await window.setPassword(password); await window.setPassword(password);
await signInByLinkingDevice(userRecoveryPhrase, 'english'); const pubkeyStr = await signInByLinkingDevice(userRecoveryPhrase, 'english');
let displayNameFromNetwork = ''; let displayNameFromNetwork = '';
SwarmPolling.getInstance().addPubkey(pubkeyStr);
SwarmPolling.getInstance().start();
await PromiseUtils.waitForTask(done => { await PromiseUtils.waitForTask(done => {
window.Whisper.events.on('configurationMessageReceived', (displayName: string) => { window.Whisper.events.on('configurationMessageReceived', (displayName: string) => {

@ -83,6 +83,7 @@ export async function signInByLinkingDevice(mnemonic: string, mnemonicLanguage:
// await for the first configuration message to come in. // await for the first configuration message to come in.
await registrationDone(pubKeyString, ''); await registrationDone(pubKeyString, '');
return pubKeyString;
} }
/** /**
* This is a signup. User has no recovery and does not try to link a device * This is a signup. User has no recovery and does not try to link a device

Loading…
Cancel
Save