Skip to content

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

fix: user data structure changes

thecodrr5e0240ea30d9
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index f6c777655..bd520d0d0 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -109,7 +109,7 @@ class Database {
switch (type) {
case "upgrade":
await this.user.set({
- notesnook: { ...user.notesnook, subscription: data },
+ subscription: data,
});
this.ev.publish("user:upgraded", data);
break;
diff --git a/packages/core/api/sync/__tests__/sync.test.js b/packages/core/api/sync/__tests__/sync.test.js
index 1dabf3fb1..1516d0088 100644
--- a/packages/core/api/sync/__tests__/sync.test.js
+++ b/packages/core/api/sync/__tests__/sync.test.js
@@ -35,7 +35,7 @@ test("sync without merge conflicts, cause merge conflicts, resolve them and then
await db.sync();
const user = await db.user.get();
- expect(user.notesnook.lastSynced).toBeGreaterThan(0);
+ expect(user.lastSynced).toBeGreaterThan(0);
/////// CAUSE MERGE CONFLICT! ///////
// 4. edit the note's content
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index 317758844..8fce2d70c 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -61,7 +61,7 @@ export default class Sync {
await this._db.conflicts.recalculate();
await this._db.conflicts.check();
- let lastSynced = user.notesnook.lastSynced || 0;
+ let lastSynced = user.lastSynced || 0;
return { user, lastSynced, token };
}