FileType doesn't need to be sequenced

This commit is contained in:
Timothy Farrell 2017-11-13 23:40:39 -06:00
parent b901bc7a26
commit 46e11b051e
2 changed files with 2 additions and 3 deletions

View File

@ -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,

View File

@ -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;
}