dexie-relay
Advanced tools
Comparing version 2.0.8 to 2.0.9
22
index.js
@@ -170,9 +170,8 @@ import {Client} from 'relay-to-relay' | ||
const stamps = hasStamp?.stamp ? datas.stamp.filter((e) => {return e.stamp > hasStamp.stamp && e.user !== this.user}) : datas.stamp | ||
for(const stamp of stamps){ | ||
try { | ||
await dataTab.put(stamp) | ||
} catch { | ||
continue | ||
} | ||
try { | ||
await dataTab.bulkAdd(stamps) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
this.emit('sync', stamps.map((data) => {return data.iden})) | ||
} | ||
@@ -187,9 +186,8 @@ if(datas.edit){ | ||
const edits = hasEdit?.edit ? datas.edit.filter((e) => {return e.edit > hasEdit.edit && e.user !== this.user}) : datas.edit | ||
for(const edit of edits){ | ||
try { | ||
await dataTab.put(edit) | ||
} catch { | ||
continue | ||
} | ||
try { | ||
await dataTab.bulkAdd(edits) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
this.emit('sync', edits.map((data) => {return data.iden})) | ||
} | ||
@@ -196,0 +194,0 @@ } else { |
{ | ||
"name": "dexie-relay", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
11717
267