Skip to content

Commit 8fac5e3

Browse files
committed
Improve sync status display/behavior
Use new sync status information from rs.js to only show sync as finished, when it was actually completed. Otherwise, wait for next sync and mark completed as reported as such.
1 parent 964570e commit 8fac5e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/widget.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class Widget {
6767
}, 1000);
6868
break;
6969
case 'sync-done':
70+
if (!msg.completed) return;
7071
this.syncInProgress = false;
7172
this.rsSyncButton.classList.remove("rs-rotate");
7273

@@ -94,8 +95,8 @@ class Widget {
9495
this.online = true;
9596
if (this.rs.hasFeature('Sync')) {
9697
this.shouldCloseWhenSyncDone = true;
97-
this.rs.on('sync-req-done', () => this.eventHandler('sync-req-done'));
98-
this.rs.on('sync-done', () => this.eventHandler('sync-done'));
98+
this.rs.on('sync-req-done', msg => this.eventHandler('sync-req-done', msg));
99+
this.rs.on('sync-done', msg => this.eventHandler('sync-done', msg));
99100
} else {
100101
this.rsSyncButton.classList.add('rs-hidden');
101102
setTimeout(this.close.bind(this), this.autoCloseAfter);

0 commit comments

Comments
 (0)