Add button for re-importing contacts from phone

Add a section under settings for performing a contact sync from your
mobile device. This just re-runs the same import operation that occurs
at install/link time.

// FREEBIE
This commit is contained in:
lilia 2016-06-16 15:33:18 -07:00
parent c01722c31b
commit 8e1d884a10
6 changed files with 152 additions and 0 deletions

View file

@ -83,6 +83,10 @@
}
});
window.getSyncRequest = function() {
return new textsecure.SyncRequest(textsecure.messaging, messageReceiver);
};
function init(firstRun) {
window.removeEventListener('online', init);
if (!textsecure.registration.isDone()) { return; }
@ -112,6 +116,7 @@
var syncRequest = new textsecure.SyncRequest(textsecure.messaging, messageReceiver);
syncRequest.addEventListener('success', function() {
console.log('sync successful');
storage.put('synced_at', Date.now());
window.dispatchEvent(new Event('textsecure:contactsync'));
});
syncRequest.addEventListener('timeout', function() {