From 0ece9bd1be252265d4599905fba5a36fdb8f91e2 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 24 Jul 2018 22:03:36 +0200 Subject: [PATCH] sync isExpanded when it's a new branch --- src/services/sync_update.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/sync_update.js b/src/services/sync_update.js index e00d992b1..536a99052 100644 --- a/src/services/sync_update.js +++ b/src/services/sync_update.js @@ -69,7 +69,11 @@ async function updateBranch(entity, sourceId) { await sql.transactional(async () => { if (orig === null || orig.dateModified < entity.dateModified) { - delete entity.isExpanded; + // isExpanded is not synced unless it's a new branch instance + // otherwise in case of full new sync we'll get all branches (even root) collapsed. + if (orig) { + delete entity.isExpanded; + } await sql.replace('branches', entity);