Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: refresh db on sse sync event

thecodrrb26b5e462ecb
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index 6e17e3c3f..cf3d32a58 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -137,7 +137,6 @@ class Database {
break;
case "sync":
await this.syncer.eventMerge(data);
- EV.publish("db:refresh");
break;
}
};
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index 0976013cc..5c1916b8a 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -25,6 +25,7 @@
* Syncing should pause until all the conflicts have been resolved
* And then it should continue.
*/
+import { EV } from "../../common";
import Constants from "../../utils/constants";
import http from "../../utils/http";
import TokenManager from "../token-manager";
@@ -97,6 +98,8 @@ export default class Sync {
// merge the server response
await this._merger.merge(serverResponse, lastSynced);
+ EV.publish("db:refresh");
+
// check for conflicts and throw
await this._db.conflicts.check();