1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: getting encryption service and UI to work

This commit is contained in:
Laurent Cozic
2017-12-14 19:39:13 +00:00
parent d9c1e30e9b
commit 2c608bca3c
12 changed files with 328 additions and 68 deletions

View File

@ -15,12 +15,26 @@ class MasterKey extends BaseItem {
return false;
}
static latest() {
return this.modelSelectOne('SELECT * FROM master_keys WHERE created_time >= (SELECT max(created_time) FROM master_keys)');
}
static async serialize(item, type = null, shownKeys = null) {
let fieldNames = this.fieldNames();
fieldNames.push('type_');
return super.serialize(item, 'master_key', fieldNames);
}
static async save(o, options = null) {
return super.save(o, options).then((item) => {
this.dispatch({
type: 'MASTERKEY_UPDATE_ONE',
item: item,
});
return item;
});
}
}
module.exports = MasterKey;