Remove redundant docCache update (onChange already handles it)
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
@@ -135,11 +135,9 @@ var DB = (function () {
|
|||||||
await local.put(doc);
|
await local.put(doc);
|
||||||
|
|
||||||
// FIX: manually trigger map() callbacks for local update
|
// FIX: manually trigger map() callbacks for local update
|
||||||
// Call onChange BEFORE updating docCache so that onChange can detect the change
|
// onChange will update docCache and notify all subscribers
|
||||||
onChange({ doc: doc });
|
onChange({ doc: doc });
|
||||||
|
|
||||||
try { docCache[_id] = typeof doc.data === 'string' ? doc.data : JSON.stringify(doc.data); } catch (e) {}
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('DB.put error', e);
|
console.error('DB.put error', e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user