From 3b8f93474146924691d1bf9383661209c461a8fb Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 5 Oct 2018 15:52:31 -0700 Subject: [PATCH] On startup, if we've just upgraded to a new version, contact sync --- js/background.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/js/background.js b/js/background.js index 12eeeb83b..68df6a812 100644 --- a/js/background.js +++ b/js/background.js @@ -743,17 +743,15 @@ PASSWORD ); - // Because v0.43.2 introduced a bug that lost contact details, v0.43.4 introduces - // a one-time contact sync to restore all lost contact/group information. We - // disable this checking if a user is first registering. - const key = 'chrome-contact-sync-v0.43.4'; - if (!storage.get(key)) { - storage.put(key, true); - + // On startup after upgrading to a new version, request a contact sync + // (but only if we're not the primary device) + if ( + !firstRun && + newVersion && // eslint-disable-next-line eqeqeq - if (!firstRun && textsecure.storage.user.getDeviceId() != '1') { - window.getSyncRequest(); - } + textsecure.storage.user.getDeviceId() != '1' + ) { + window.getSyncRequest(); } const deviceId = textsecure.storage.user.getDeviceId();