fix(sync-status): Update how we calculate sync status

Summary: Concommitant diff to D3677

Test Plan: manual

Reviewers: halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3678
This commit is contained in:
Christine Spang 2017-01-14 13:34:31 -08:00
parent c45dbdc48d
commit a6325b5b51
2 changed files with 5 additions and 3 deletions

2
src/K2

@ -1 +1 @@
Subproject commit 44f8bf0627a4a3bfa1378bcc322967af6692f711
Subproject commit 387d6894159376f5aecc6216ab451f4594ee48e8

View file

@ -95,9 +95,11 @@ class NylasSyncStatusStore extends NylasStore {
const updates = {}
for (const folder of folders) {
const name = folder.name || folder.displayName
const {uidnext, fetchedmin, fetchedmax, oldestProcessedDate} = folder.syncState || {}
const {uidnext, fetchedmin, fetchedmax, minUID, oldestProcessedDate} = folder.syncState || {}
if (uidnext) {
const progress = (+fetchedmax - +fetchedmin + 1) / uidnext
// TODO: when we unify the databases, we shouldn't need code to
// calculate this in two different places anymore
const progress = (+minUID + (+fetchedmax - +fetchedmin) + 1) / uidnext
updates[name] = {
progress,
total: uidnext,