Skip to content

Commit

Permalink
fix: remove warning on solve
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed May 15, 2024
1 parent 7f13227 commit d6d3df2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/super-tag/widgets/utils/formOnChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ export function formOnChange(currentTiddlerTitle?: string, editor?: JSONEditor.J
}
// Get an array of errors from the validator
const errors = editor.validate();
// DEBUG: console errors
console.log(`errors`, errors);
if (errors.length > 0) {
if (errorValidatorInfoElement !== undefined) {
errorValidatorInfoElement.className = 'label label-warning';
errorValidatorInfoElement.textContent = 'Form not valid';
errorValidatorInfoElement.textContent = `Form not valid (${errors.map((error) => error.message).join(', ')})`;
}
} else {
if (errorValidatorInfoElement !== undefined) {
errorValidatorInfoElement.className = 'label';
errorValidatorInfoElement.textContent = '';
}
}
let tiddlerFields = $tw.wiki.getTiddler(currentTiddlerTitle)?.fields ?? ({} as Record<string, unknown>);
Expand Down

0 comments on commit d6d3df2

Please sign in to comment.