Skip to content

Commit a9ab729

Browse files
committed
make sync run async
closes #30
1 parent a10fb3e commit a9ab729

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/add.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ export default async function add(table, path, options = {}) {
5555
const filter = path.replace(pathRegEx, '$3').replace('include=', 'include=id,$created,$updated,$deleted')
5656

5757
// Run synchronization with interval
58-
function runSync() {
58+
async function runSync() {
5959

6060
// User is online
6161
if (window.navigator.onLine) {
6262

6363
// Sync from remote
6464
if (!path.startsWith('to:')) {
65-
syncFromRemote(table, path, api, remoteTable, filter, localStorageKey)
65+
await syncFromRemote(table, path, api, remoteTable, filter, localStorageKey)
6666
}
6767

6868
// Sync to remote
6969
if (!path.startsWith('from:')) {
70-
syncToRemote(table, api, remoteTable)
70+
await syncToRemote(table, api, remoteTable)
7171
}
7272

7373
// User is offline

0 commit comments

Comments
 (0)