${state.modal(state, emit, close)}
diff --git a/app/ui/signupDialog.js b/app/ui/signupDialog.js
index 23fe9a66..970150a6 100644
--- a/app/ui/signupDialog.js
+++ b/app/ui/signupDialog.js
@@ -1,16 +1,15 @@
const html = require('choo/html');
const assets = require('../../common/assets');
-const { bytes, platform } = require('../utils');
+const { bytes } = require('../utils');
const { canceledSignup, submittedSignup } = require('../metrics');
module.exports = function(trigger) {
return function(state, emit, close) {
const DAYS = Math.floor(state.LIMITS.MAX_EXPIRE_SECONDS / 86400);
- const hidden = platform() === 'android' ? 'hidden' : '';
let submitting = false;
return html`
${state.translate('accountBenefitSync')}
- ${state.translate('accountBenefitMoz')}
{
+ const refreshed = await this.refresh();
+ if (refreshed) {
+ return await this.syncFileList();
+ } else {
+ return { incoming: true };
}
- }
+ };
try {
- const encrypted = await getFileList(
- this.bearerToken,
- this.refreshToken,
- kid
- );
+ const encrypted = await getFileList(this.bearerToken, kid);
const decrypted = await streamToArrayBuffer(
decryptStream(blobStream(encrypted), key)
);
list = JSON.parse(textDecoder.decode(decrypted));
} catch (e) {
- return retry(e);
+ if (e.message === '401') {
+ return retry(e);
+ }
}
changes = await this.storage.merge(list);
if (!changes.outgoing) {
@@ -303,9 +303,11 @@ export default class User {
const encrypted = await streamToArrayBuffer(
encryptStream(blobStream(blob), key)
);
- await setFileList(this.bearerToken, this.refreshToken, kid, encrypted);
+ await setFileList(this.bearerToken, kid, encrypted);
} catch (e) {
- return retry(e);
+ if (e.message === '401') {
+ return retry(e);
+ }
}
return changes;
}