Kick off checks for updates in more situations

This commit is contained in:
Scott Nonnenberg 2019-10-03 12:07:35 -07:00
parent 5c00b89600
commit 0f93c780ec
5 changed files with 79 additions and 58 deletions

View file

@ -391,6 +391,11 @@
}, },
showStickerPack: async (packId, key) => { showStickerPack: async (packId, key) => {
// We can get these events even if the user has never linked this instance.
if (Whisper.Import.isIncomplete() || !Whisper.Registration.everDone()) {
return;
}
// Kick off the download // Kick off the download
window.Signal.Stickers.downloadEphemeralPack(packId, key); window.Signal.Stickers.downloadEphemeralPack(packId, key);

View file

@ -30,6 +30,8 @@
// the actual next step happens in confirmNumber() on submit form #link-phone // the actual next step happens in confirmNumber() on submit form #link-phone
}, },
initialize(options = {}) { initialize(options = {}) {
window.readyForUpdates();
this.selectStep(Steps.SCAN_QR_CODE); this.selectStep(Steps.SCAN_QR_CODE);
this.connect(); this.connect();
this.on('disconnected', this.reconnect); this.on('disconnected', this.reconnect);

View file

@ -12,6 +12,8 @@
templateName: 'standalone', templateName: 'standalone',
className: 'full-screen-flow', className: 'full-screen-flow',
initialize() { initialize() {
window.readyForUpdates();
this.accountManager = getAccountManager(); this.accountManager = getAccountManager();
this.render(); this.render();

16
main.js
View file

@ -399,7 +399,14 @@ ipc.on('show-window', () => {
showWindow(); showWindow();
}); });
ipc.once('ready-for-updates', async () => { let isReadyForUpdates = false;
async function readyForUpdates() {
if (isReadyForUpdates) {
return;
}
isReadyForUpdates = true;
// First, install requested sticker pack // First, install requested sticker pack
if (process.argv.length > 1) { if (process.argv.length > 1) {
const [incomingUrl] = process.argv; const [incomingUrl] = process.argv;
@ -417,7 +424,12 @@ ipc.once('ready-for-updates', async () => {
error && error.stack ? error.stack : error error && error.stack ? error.stack : error
); );
} }
}); }
ipc.once('ready-for-updates', readyForUpdates);
const TEN_MINUTES = 10 * 60 * 1000;
setTimeout(readyForUpdates, TEN_MINUTES);
function openReleaseNotes() { function openReleaseNotes() {
shell.openExternal( shell.openExternal(

View file

@ -596,25 +596,25 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$('#qr img').remove();", "line": " this.$('#qr img').remove();",
"lineNumber": 133,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
"line": " this.$('#qr .container').show();",
"lineNumber": 135, "lineNumber": 135,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
}, },
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
"line": " this.$('#qr .container').show();",
"lineNumber": 137,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " if ($('#qr').length === 0) {", "line": " if ($('#qr').length === 0) {",
"lineNumber": 139, "lineNumber": 141,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -623,7 +623,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$('#qr .container').hide();", "line": " this.$('#qr .container').hide();",
"lineNumber": 144, "lineNumber": 146,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -632,25 +632,25 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.qr = new QRCode(this.$('#qr')[0]).makeCode(url);", "line": " this.qr = new QRCode(this.$('#qr')[0]).makeCode(url);",
"lineNumber": 145,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
"line": " this.$('#qr').addClass('ready');",
"lineNumber": 147, "lineNumber": 147,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
}, },
{
"rule": "jQuery-$(",
"path": "js/views/install_view.js",
"line": " this.$('#qr').addClass('ready');",
"lineNumber": 149,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$(DEVICE_NAME_SELECTOR).val(deviceName || window.getHostName());", "line": " this.$(DEVICE_NAME_SELECTOR).val(deviceName || window.getHostName());",
"lineNumber": 152, "lineNumber": 154,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -659,7 +659,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$('#link-phone').submit();", "line": " this.$('#link-phone').submit();",
"lineNumber": 157, "lineNumber": 159,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -668,7 +668,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$('#link-phone').submit(e => {", "line": " this.$('#link-phone').submit(e => {",
"lineNumber": 167, "lineNumber": 169,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -677,7 +677,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " let name = this.$(DEVICE_NAME_SELECTOR).val();", "line": " let name = this.$(DEVICE_NAME_SELECTOR).val();",
"lineNumber": 171, "lineNumber": 173,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -686,7 +686,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/install_view.js", "path": "js/views/install_view.js",
"line": " this.$(DEVICE_NAME_SELECTOR).focus();", "line": " this.$(DEVICE_NAME_SELECTOR).focus();",
"lineNumber": 174, "lineNumber": 176,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -982,7 +982,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('input.number').val(number);", "line": " this.$('input.number').val(number);",
"lineNumber": 21, "lineNumber": 23,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -991,25 +991,25 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " el: this.$('#phone-number-input'),", "line": " el: this.$('#phone-number-input'),",
"lineNumber": 24,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js",
"line": " this.$('#error').hide();",
"lineNumber": 26, "lineNumber": 26,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
}, },
{
"rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js",
"line": " this.$('#error').hide();",
"lineNumber": 28,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " const verificationCode = $('#code')", "line": " const verificationCode = $('#code')",
"lineNumber": 37, "lineNumber": 39,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1018,7 +1018,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#status').text(s);", "line": " this.$('#status').text(s);",
"lineNumber": 50, "lineNumber": 52,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1027,7 +1027,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " const verificationCode = $('#code')", "line": " const verificationCode = $('#code')",
"lineNumber": 53, "lineNumber": 55,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1036,7 +1036,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#error')", "line": " this.$('#error')",
"lineNumber": 64, "lineNumber": 66,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1045,7 +1045,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " if (this.$('#number-container').hasClass('valid')) {", "line": " if (this.$('#number-container').hasClass('valid')) {",
"lineNumber": 71, "lineNumber": 73,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1054,7 +1054,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#request-sms, #request-voice').prop('disabled', 'disabled');", "line": " this.$('#request-sms, #request-voice').prop('disabled', 'disabled');",
"lineNumber": 74, "lineNumber": 76,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1063,25 +1063,25 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#code').addClass('invalid');", "line": " this.$('#code').addClass('invalid');",
"lineNumber": 79,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{
"rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js",
"line": " this.$('#code').removeClass('invalid');",
"lineNumber": 81, "lineNumber": 81,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
}, },
{
"rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js",
"line": " this.$('#code').removeClass('invalid');",
"lineNumber": 83,
"reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#error').hide();", "line": " this.$('#error').hide();",
"lineNumber": 86, "lineNumber": 88,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1090,7 +1090,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#step2')", "line": " this.$('#step2')",
"lineNumber": 92, "lineNumber": 94,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1099,7 +1099,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#number-container').addClass('invalid');", "line": " this.$('#number-container').addClass('invalid');",
"lineNumber": 96, "lineNumber": 98,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1108,7 +1108,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " $('#error').hide();", "line": " $('#error').hide();",
"lineNumber": 101, "lineNumber": 103,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1117,7 +1117,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#step2')", "line": " this.$('#step2')",
"lineNumber": 107, "lineNumber": 109,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -1126,7 +1126,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/views/standalone_registration_view.js", "path": "js/views/standalone_registration_view.js",
"line": " this.$('#number-container').addClass('invalid');", "line": " this.$('#number-container').addClass('invalid');",
"lineNumber": 111, "lineNumber": 113,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"