...
 
Commits (2)
......@@ -37,9 +37,13 @@ export default memo((props: { task: Assignment, active: boolean, select: (id: st
task.class &&
` — ${task.class}`
}
{
(task.subject || task.class)
&& ` · `
}
{
validDate(due) &&
` · due ${moment(due).fromNow()}`
`due ${moment(due).calendar()}`
}
</Typography>
<br />
......
......@@ -110,9 +110,12 @@ export class ReactiveDB extends EventEmitter {
async update(task: Assignment) {
if (!task.id.startsWith('local_')) {
await updateAssignment(task as any);
await this.db.entries
.update(task.id, omit(task, [ 'id' ]));
try {
await updateAssignment(task as any);
} catch { }
} else {
await this.db.entries
.add(task);
......