mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
web: check for internet reachability before sync
This commit is contained in:
@@ -287,8 +287,13 @@ class AppStore extends BaseStore {
|
||||
};
|
||||
|
||||
sync = async (full = true, force = false) => {
|
||||
if (!this.get().isSyncEnabled || !navigator.onLine) return;
|
||||
if (this.isSyncing()) return;
|
||||
if (
|
||||
this.isSyncing() ||
|
||||
!this.get().isSyncEnabled ||
|
||||
!navigator.onLine ||
|
||||
!(await networkCheck.waitForInternet())
|
||||
)
|
||||
return;
|
||||
|
||||
clearTimeout(syncStatusTimeout);
|
||||
this.updateLastSynced();
|
||||
|
||||
Reference in New Issue
Block a user