signInWithRecovery = show full screen loader

pull/1512/head
Audric Ackermann 4 years ago
parent 39f8ca293a
commit 4a794e90a0
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -207,6 +207,10 @@ export async function signInWithRecovery(signInDetails: {
}
}
/**
* This is will try to sign in with the user recovery phrase.
* If no ConfigurationMessage is received in 60seconds, the loading will be canceled.
*/
export async function signInWithLinking(signInDetails: {
userRecoveryPhrase: string;
password: string;
@ -236,7 +240,7 @@ export async function signInWithLinking(signInDetails: {
displayNameFromNetwork = displayName;
}
);
}, 30000);
}, 60000);
if (displayNameFromNetwork.length) {
// display name, avatars, groups and contacts should already be handled when this event was triggered.
window.log.info('We got a displayName from network: ');

@ -224,9 +224,25 @@ export const SignInTab = () => {
handleContinueYourSessionClick={continueYourSession}
disabled={!activateContinueButton}
/>
<Flex container={true} justifyContent="center">
<SessionSpinner loading={loading} />
</Flex>
{loading && (
<Flex
container={true}
justifyContent="center"
alignItems="center"
style={{
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
pointerEvents: 'all',
backgroundColor: '#00000088',
}}
>
<SessionSpinner loading={true} />
</Flex>
)}
{showTermsAndConditions && <TermsAndConditions />}
</div>
);

@ -384,7 +384,20 @@ export async function retrieveNextMessages(
// NOTE: Retrieve cannot result in "wrong POW", but we call
// `checkResponse` to check for "wrong swarm"
checkResponse(res);
try {
checkResponse(res);
} catch (e) {
window.log.warn(
'loki_message:::retrieveNextMessages - send error:',
e.code,
e.message
);
if (e instanceof window.textsecure.WrongSwarmError) {
const { newSwarm } = e;
await updateSnodesFor(params.pubKey, newSwarm);
return [];
}
}
if (res.status !== 200) {
window.log('retrieve result is not 200');

@ -39,7 +39,11 @@ describe('MessageQueue', () => {
let messageQueueStub: MessageQueue;
// Message Sender Stubs
let sendStub: sinon.SinonStub<[RawMessage, (number | undefined)?, (number | undefined)?]>;
let sendStub: sinon.SinonStub<[
RawMessage,
(number | undefined)?,
(number | undefined)?
]>;
beforeEach(() => {
// Utils Stubs
@ -122,19 +126,19 @@ describe('MessageQueue', () => {
it('should send a success event if message was sent', done => {
const device = TestUtils.generateFakePubKey();
const message = TestUtils.generateChatMessage();
const waitForMessageSentEvent = async () => new Promise<void>(resolve => {
resolve();
try {
expect(messageSentHandlerSuccessStub.callCount).to.be.equal(1);
expect(
messageSentHandlerSuccessStub.lastCall.args[0].identifier
).to.be.equal(message.identifier);
done();
} catch (e) {
done(e);
}
});
const waitForMessageSentEvent = async () =>
new Promise<void>(resolve => {
resolve();
try {
expect(messageSentHandlerSuccessStub.callCount).to.be.equal(1);
expect(
messageSentHandlerSuccessStub.lastCall.args[0].identifier
).to.be.equal(message.identifier);
done();
} catch (e) {
done(e);
}
});
void pendingMessageCache
.add(device, message, waitForMessageSentEvent)

Loading…
Cancel
Save