Skip to content

Commit

Permalink
refactor: . flip &&s
Browse files Browse the repository at this point in the history
  • Loading branch information
ilandikov committed Sep 21, 2024
1 parent cfa30a6 commit 5deae66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/StatusEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
function setStatusRelatedDate(currentValue: string, isInStatus: boolean, editedValue: TasksDate) {
const dateFieldIsEmpty = currentValue === '';
if (dateFieldIsEmpty && isInStatus) {
if (isInStatus && dateFieldIsEmpty) {
// the date field is empty and the status was set (set the date from the task with the applied status)
return editedValue.formatAsDate();
}
if (!dateFieldIsEmpty && !isInStatus) {
if (!isInStatus && !dateFieldIsEmpty) {
// the date field is not empty but another status was set (clean the date field)
return '';
}
Expand Down

0 comments on commit 5deae66

Please sign in to comment.