mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: settings not getting synced after a change
This commit is contained in:
@@ -138,6 +138,7 @@ class Settings {
|
||||
}
|
||||
|
||||
async _saveSettings() {
|
||||
this._settings.dateEdited = Date.now();
|
||||
await this._db.storage.write("settings", this._settings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ class Collector {
|
||||
async collect(lastSyncedTimestamp) {
|
||||
this._lastSyncedTimestamp = lastSyncedTimestamp;
|
||||
this.key = await this._db.user.getEncryptionKey();
|
||||
|
||||
return {
|
||||
notes: await this._encrypt(this._collect(this._db.notes.raw)),
|
||||
notebooks: await this._encrypt(this._collect(this._db.notebooks.raw)),
|
||||
|
||||
@@ -157,7 +157,7 @@ export default class Sync {
|
||||
this.stopAutoSync();
|
||||
this._autoSyncTimeout = setTimeout(() => {
|
||||
EV.publish(EVENTS.databaseSyncRequested);
|
||||
}, this._autoSyncTimeout);
|
||||
}, this._autoSyncInterval);
|
||||
}
|
||||
|
||||
async _send(data) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
function areAllEmpty(obj) {
|
||||
const arrays = Object.values(obj).filter((v) => v && v.length !== undefined);
|
||||
return arrays.every((array) => array.length === 0);
|
||||
for (let key in obj) {
|
||||
const value = obj[key];
|
||||
if (Array.isArray(value) && value.length > 0) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export { areAllEmpty };
|
||||
|
||||
Reference in New Issue
Block a user