Skip to content

Commit 4063bf8

Browse files
authored
Merge pull request #139 from remotestorage/ui/last-synced
Simplify/improve sync status in widget UI
2 parents ff193bd + 061efcf commit 4063bf8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/widget.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,17 +527,12 @@ class Widget {
527527
const now = new Date();
528528
if (this.online) {
529529
this.lastSynced = now;
530-
this.rsConnectedLabel.textContent = 'Synced just now';
531-
return;
532-
}
533-
if (!this.lastSynced) {
530+
this.rsConnectedLabel.textContent = 'Synced';
531+
} else {
534532
if (!this.rsWidget.classList.contains('rs-state-unauthorized')) {
535533
this.rsConnectedLabel.textContent = 'Offline';
536534
}
537-
return;
538535
}
539-
const secondsSinceLastSync = Math.round((now.getTime() - this.lastSynced.getTime())/1000);
540-
this.rsConnectedLabel.textContent = `Synced ${secondsSinceLastSync} seconds ago`;
541536
}
542537

543538
isSmallScreen () {

0 commit comments

Comments
 (0)