client/views: fix incorrectly 'checked' checkboxes

When similar posts were found, the anonymous upload checkbox for that
image would become checked, because we treat anything !== undefined
as 'checked', and in post_upload_views.js we set 'anonymous' to
a querySelector, which returns null on failure and not undefined.
Treat null as 'unchecked' to fix this issue, and prevent future mistakes
slipping past.
This commit is contained in:
Eva 2023-05-19 17:52:34 +02:00 committed by neobooru
parent 66143dce20
commit 94d145e8d0

View file

@ -81,7 +81,7 @@ function makeCheckbox(options) {
name: options.name,
value: options.value,
type: "checkbox",
checked: options.checked !== undefined ? options.checked : false,
checked: options.checked !== undefined && options.checked !== null ? options.checked : false,
disabled: options.readonly,
required: options.required,
}),