1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-18 23:07:45 +02:00

Desktop: Create new notes with minimum set of properties to prevent a few minor bugs

This commit is contained in:
Laurent Cozic
2020-06-02 22:27:36 +01:00
parent e117b6f732
commit dd557f66a5
4 changed files with 44 additions and 5 deletions

View File

@ -47,6 +47,14 @@ class BaseModel {
return null;
}
static defaultValues(fieldNames) {
const output = {};
for (const n of fieldNames) {
output[n] = this.db().fieldDefaultValue(this.tableName(), n);
}
return output;
}
static modelIndexById(items, id) {
for (let i = 0; i < items.length; i++) {
if (items[i].id == id) return i;