Skip to content

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

feat: do not push sync if nothing is changed

thecodrr81d4c921c540
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index bd7a15100..8be8194de 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -31,6 +31,7 @@ import http from "../../utils/http";
import TokenManager from "../token-manager";
import Collector from "./collector";
import Merger from "./merger";
+import { areAllEmpty } from "./utils";
export default class Sync {
/**
*
@@ -111,6 +112,8 @@ export default class Sync {
}
async _send(data, token) {
+ if (areAllEmpty(data)) return;
+
let response = await http.post.json(
`${Constants.API_HOST}/sync`,
data,