feat: recalculate conflicts on sync

This commit is contained in:
thecodrr
2020-04-04 13:29:33 +05:00
parent 10ee35a145
commit 4dc3d2fe44
4 changed files with 65 additions and 44 deletions

View File

@@ -0,0 +1,18 @@
import Database from "./index";
class Conflicts {
/**
*
* @param {Database} db
*/
constructor(db) {
this._db = db;
}
recalculate = async () => {
if (this._db.notes.conflicted.length < 0) {
await this._db.context.write("hasConflicts", false);
}
};
}
export default Conflicts;