fix type error

This commit is contained in:
“chrisshank” 2024-12-10 14:39:12 -08:00
parent 0fab1e3c04
commit cad3fb2023
1 changed files with 2 additions and 3 deletions

View File

@ -162,15 +162,14 @@ to.${key} = ${value};`);
#evaluateExpression = (event?: Event) => {
if (this.sourceElement === null || this.targetElement === null) return;
this.stroke = 'black';
if (!this.#function) return;
try {
this.#function(this.sourceElement, this.targetElement, event);
this.style.setProperty('--folk-rope-color', '');
} catch (error) {
console.warn('Failed to evaluate expression:', error);
this.stroke = 'red';
this.style.setProperty('--folk-rope-color', 'red');
}
};
}