You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Desktop: Add OneNote Importer (#11392)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import paginationToSql from './models/utils/paginationToSql';
|
||||
import Database from './database';
|
||||
import uuid from './uuid';
|
||||
import time from './time';
|
||||
import JoplinDatabase, { TableField } from './JoplinDatabase';
|
||||
import { LoadOptions, SaveOptions } from './models/utils/types';
|
||||
import ActionLogger, { ItemActionType as ItemActionType } from './utils/ActionLogger';
|
||||
import { BaseItemEntity, SqlQuery } from './services/database/types';
|
||||
import uuid from './uuid';
|
||||
const Mutex = require('async-mutex').Mutex;
|
||||
|
||||
// New code should make use of this enum
|
||||
@@ -80,6 +80,8 @@ class BaseModel {
|
||||
['TYPE_COMMAND', ModelType.Command],
|
||||
];
|
||||
|
||||
private static uuidGenerator: ()=> string = uuid.create;
|
||||
|
||||
public static TYPE_NOTE = ModelType.Note;
|
||||
public static TYPE_FOLDER = ModelType.Folder;
|
||||
public static TYPE_SETTING = ModelType.Setting;
|
||||
@@ -576,7 +578,7 @@ class BaseModel {
|
||||
|
||||
if (options.isNew) {
|
||||
if (this.useUuid() && !o.id) {
|
||||
modelId = uuid.create();
|
||||
modelId = this.generateUuid();
|
||||
o.id = modelId;
|
||||
}
|
||||
|
||||
@@ -757,6 +759,15 @@ class BaseModel {
|
||||
return this.db_;
|
||||
}
|
||||
|
||||
public static generateUuid() {
|
||||
return this.uuidGenerator();
|
||||
}
|
||||
|
||||
public static setIdGenerator(generator: ()=> string) {
|
||||
const previous = this.uuidGenerator;
|
||||
this.uuidGenerator = generator;
|
||||
return previous;
|
||||
}
|
||||
// static isReady() {
|
||||
// return !!this.db_;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user