fix: encrypt items before sync

This commit is contained in:
thecodrr
2022-03-28 10:45:41 +05:00
parent ff475678c2
commit ebe06bd4e0
3 changed files with 26 additions and 8 deletions

View File

@@ -59,6 +59,11 @@ class RealtimeMerger {
attachment: {
set: async (item) => {
const remoteAttachment = await this._deserialize(item);
if (remoteAttachment.deleted) {
await this._db.attachments.merge(remoteAttachment);
return;
}
const localAttachment = this._db.attachments.attachment(
remoteAttachment.metadata.hash
);