FileType doesn't need to be sequenced
This commit is contained in:
parent
c34fed16bb
commit
0fba33499d
@ -6,8 +6,6 @@ import { blobToArrayBuffer } from '../utils/conversion.js';
|
||||
export const FileType = PouchDB.registerType({
|
||||
name: 'File',
|
||||
getUniqueID: doc => doc.digest.substr(0, 16),
|
||||
getSequence: doc =>
|
||||
new Date(doc.modifiedDate ? doc.modifiedDate : new Date().toISOString()).getTime(),
|
||||
// schema: {
|
||||
// name: t.REQUIRED_STRING,
|
||||
// mimetype: t.REQUIRED_STRING,
|
||||
|
||||
@ -60,7 +60,8 @@ export function PouchORM(PouchDB) {
|
||||
|
||||
function populateId(doc) {
|
||||
if (!doc._id) {
|
||||
doc._id = `${prefix}_${getSequence(doc).toString(36)}_${getUniqueID(doc)}`;
|
||||
const sequence = getSequence ? getSequence(doc).toString(36) : '';
|
||||
doc._id = `${prefix}_${sequence}_${getUniqueID(doc)}`;
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user