mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-10 01:00:05 +00:00
[editor] Fix non-optional booleans causing rules to be non-saveable
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
897b97a833
commit
bd9bddc9b1
1 changed files with 3 additions and 3 deletions
|
@ -1015,7 +1015,7 @@ export default {
|
||||||
// Check for zero-values and drop the field on zero-value
|
// Check for zero-values and drop the field on zero-value
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'bool':
|
case 'bool':
|
||||||
if (att[1] === false) {
|
if (att[1] === false && field.optional) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
@ -1109,7 +1109,7 @@ export default {
|
||||||
|
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'bool':
|
case 'bool':
|
||||||
if (!field.optional && !action.attributes[field.key]) {
|
if (!field.optional && typeof action.attributes[field.key] !== 'boolean') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
@ -1222,7 +1222,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const field of def.fields) {
|
for (const field of def.fields) {
|
||||||
if (!field.optional && !action.attributes[field.key]) {
|
if (!field.optional && action.attributes[field.key] === undefined) {
|
||||||
this.validateReason = `${action.type} -> ${field.key} -> opt`
|
this.validateReason = `${action.type} -> ${field.key} -> opt`
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue