mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
fix(engine): minor bug fixes
This commit is contained in:
parent
1c5bd0c473
commit
8937087274
@ -344,7 +344,7 @@ class Actions {
|
||||
this.context.showValidationErrors = true;
|
||||
let validationErrors = this.context.RootBlocks.validate();
|
||||
if (params) {
|
||||
const blockIds = type.isString(blockId) ? [params] : params;
|
||||
const blockIds = type.isString(params) ? [params] : params;
|
||||
validationErrors = validationErrors.filter((block) => {
|
||||
return blockIds.includes(block.blockId);
|
||||
});
|
||||
|
@ -496,7 +496,7 @@ class Blocks {
|
||||
|
||||
getValidateRec(result) {
|
||||
this.loopBlocks((block) => {
|
||||
if (block.validationEval.output.status === 'error' && block.visibleEval.output) {
|
||||
if (block.visibleEval.output && block.validationEval.output.status === 'error') {
|
||||
result.push({
|
||||
blockId: block.blockId,
|
||||
validation: block.validationEval.output,
|
||||
|
@ -56,8 +56,8 @@ class State {
|
||||
unset(this.context.state, field);
|
||||
// remove all empty objects from state as an effect of deleted values
|
||||
const fields = field.split('.');
|
||||
if (fields.length > 0) {
|
||||
const parent = ''.join(fields.slice(0, fields.length - 1));
|
||||
if (fields.length > 1) {
|
||||
const parent = fields.slice(0, fields.length - 1).join('.');
|
||||
const parentValue = get(this.context.state, parent);
|
||||
if (type.isObject(parentValue) && Object.keys(parentValue).length === 0) {
|
||||
this.del(parent);
|
||||
|
Loading…
Reference in New Issue
Block a user