From 18967ddb163340922ea8465b8651bd2d44ab9605 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 13 Mar 2020 11:16:56 +0200 Subject: [PATCH] TaskEdit: use null coalescing instead of ||. It technically works because undefined happens to be falsey, but still bad practice and can lead to errors (especially when copy-pasting). --- src/components/Tasks/TaskEdit.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Tasks/TaskEdit.tsx b/src/components/Tasks/TaskEdit.tsx index a54f2ac..b80a56b 100644 --- a/src/components/Tasks/TaskEdit.tsx +++ b/src/components/Tasks/TaskEdit.tsx @@ -94,7 +94,7 @@ class TaskEdit extends React.PureComponent { this.state.uid = event.uid; this.state.title = event.title ? event.title : ''; this.state.status = event.status; - this.state.priority = event.priority || TaskPriorityType.Undefined; + this.state.priority = event.priority ?? TaskPriorityType.Undefined; if (event.startDate) { this.state.allDay = event.startDate.isDate; this.state.start = event.startDate.convertToZone(ICAL.Timezone.localTimezone).toJSDate();