Skip to content

Commit 19fcfe0

Browse files
committed
fix(frontend/bulk-edit): unsaved changes warning for task when task not changed
this was caused by ```glimmer {{#if (and f.model.change.task (not (eq f.model.change.task.id model.task.id)) ) }} <ChangedWarning /> {{/if}} ``` when the changeset is modified `f.model.change.task` will be set to an empty object, this satisfies the first condition as objects are always truthy: ```glimmer {{#if (and {} (not (eq f.model.change.task.id model.task.id)) ) }} <ChangedWarning /> {{/if}} ``` when we now look at the values of `f.model.change.task.id` and `model.task.id`, we can see that: `f.model.change.task.id` -> `undefined` `model.task.id` -> `null` `null` and `undefined` aren't the same, therefore: `(not (eq f.model.change.task.id model.task.id))` -> `(not (eq undefined null))` -> `(not (false))` -> `true` because of that, modifying another value of the changeset resulted in: ```glimmer {{#if (and {} true ) }} <ChangedWarning /> {{/if}} ```
1 parent 8630552 commit 19fcfe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/app/analysis/edit/template.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
{{/unless}}
9797
{{#if
9898
(and
99-
f.model.change.task
99+
f.model.change.task.id
100100
(not (eq f.model.change.task.id model.task.id))
101101
)
102102
}}

0 commit comments

Comments
 (0)