A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: add push-only syncing
thecodrr310899d0d6f5
diff --git a/packages/core/api/index.js b/packages/core/api/index.jsindex b9bfc7e35..5fad17500 100644--- a/packages/core/api/index.js+++ b/packages/core/api/index.js@@ -134,8 +134,8 @@ class Database {}, 15 * 1000);}- sync() {- return this.syncer.start();+ sync(full) {+ return this.syncer.start(full);}host(host) {diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.jsindex 2cfab3022..0f22bcddb 100644--- a/packages/core/api/sync/index.js+++ b/packages/core/api/sync/index.js@@ -65,16 +65,18 @@ export default class Sync {return { user, lastSynced, token };}- async start() {+ async start(full) {let { lastSynced, token } = await this._performChecks();- let serverResponse = await this._fetch(lastSynced, token);+ if (full) var serverResponse = await this._fetch(lastSynced, token);// we prepare local data before merging so we always have correct dataconst data = await this._collector.collect(lastSynced);- // merge the server response- await this._merger.merge(serverResponse, lastSynced);+ if (full) {+ // merge the server response+ await this._merger.merge(serverResponse, lastSynced);+ }// check for conflicts and throwawait this._db.conflicts.check();