Fix setting of mtime for newly created items.

master
Tom Hacohen 4 years ago
parent 26788cc749
commit 059522532a

@ -65,7 +65,7 @@ export default function CalendarsMain() {
const collection = collections!.find((x) => x.uid === collectionUid)!; const collection = collections!.find((x) => x.uid === collectionUid)!;
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const content = item.toIcal(); const content = item.toIcal();
let eteItem; let eteItem;
@ -95,7 +95,7 @@ export default function CalendarsMain() {
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const eteItem = items!.get(collectionUid)?.get(itemUid)!; const eteItem = items!.get(collectionUid)?.get(itemUid)!;
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const meta = await eteItem.getMeta(); const meta = await eteItem.getMeta();
meta.mtime = mtime; meta.mtime = mtime;
await eteItem.setMeta(meta); await eteItem.setMeta(meta);

@ -61,7 +61,7 @@ export default function ImportDialog(props: PropsType) {
const eteItems = []; const eteItems = [];
for (const item of items) { for (const item of items) {
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const meta = { const meta = {
mtime, mtime,
name: item.uid, name: item.uid,

@ -61,7 +61,7 @@ export default function ContactsMain() {
const collection = collections!.find((x) => x.uid === collectionUid)!; const collection = collections!.find((x) => x.uid === collectionUid)!;
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const content = item.toIcal(); const content = item.toIcal();
let eteItem; let eteItem;
@ -91,7 +91,7 @@ export default function ContactsMain() {
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const eteItem = items!.get(collectionUid)?.get(itemUid)!; const eteItem = items!.get(collectionUid)?.get(itemUid)!;
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const meta = await eteItem.getMeta(); const meta = await eteItem.getMeta();
meta.mtime = mtime; meta.mtime = mtime;
await eteItem.setMeta(meta); await eteItem.setMeta(meta);

@ -61,7 +61,7 @@ export default function TasksMain() {
const collection = collections!.find((x) => x.uid === collectionUid)!; const collection = collections!.find((x) => x.uid === collectionUid)!;
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const content = item.toIcal(); const content = item.toIcal();
let eteItem; let eteItem;
@ -91,7 +91,7 @@ export default function TasksMain() {
const itemMgr = colMgr.getItemManager(collection); const itemMgr = colMgr.getItemManager(collection);
const eteItem = items!.get(collectionUid)?.get(itemUid)!; const eteItem = items!.get(collectionUid)?.get(itemUid)!;
const mtime = (new Date()).getUTCMilliseconds(); const mtime = (new Date()).getTime();
const meta = await eteItem.getMeta(); const meta = await eteItem.getMeta();
meta.mtime = mtime; meta.mtime = mtime;
await eteItem.setMeta(meta); await eteItem.setMeta(meta);

Loading…
Cancel
Save