Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.modal.delete("Base Command").then(() => {
// Reset the expression's validity
// @TODO: if this is an ExpressionModel, model won't revalidate when an entry is removed
const entryAtIndex = this.formControl.at(index).value;
if (entryAtIndex instanceof ExpressionModel) {
entryAtIndex.clearIssue(ErrorCode.EXPR_ALL);
}
this.formControl.removeAt(index);
this.cdr.markForCheck();
}, err => {
console.warn(err);
this.modal.delete("secondary file").then(() => {
// Reset the expression's validity
const entryAtIndex = this.formControl.at(index).value;
if (entryAtIndex) {
entryAtIndex.clearIssue(ErrorCode.EXPR_ALL);
}
this.formControl.removeAt(index);
this.cdr.markForCheck();
}, err => {
console.warn(err);
this.modal.delete("hint").then(() => {
this.model.hints[i].clearIssue(ErrorCode.EXPR_ALL);
this.model.hints.splice(i, 1);
(this.form.get("hints") as FormArray).removeAt(i);
this.update.emit(this.model.hints);
}, err => {
console.warn(err);