Skip to content

Commit

Permalink
fix: Fix unsafe cast in Input.setVisible().
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko committed Dec 13, 2024
1 parent 0104166 commit 04dd92a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/inputs/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {Connection} from '../connection.js';
import type {ConnectionType} from '../connection_type.js';
import type {Field} from '../field.js';
import * as fieldRegistry from '../field_registry.js';
import type {RenderedConnection} from '../rendered_connection.js';
import {RenderedConnection} from '../rendered_connection.js';
import {Align} from './align.js';
import {inputTypes} from './input_types.js';

Expand Down Expand Up @@ -181,15 +181,14 @@ export class Input {
for (let y = 0, field; (field = this.fieldRow[y]); y++) {
field.setVisible(visible);
}
if (this.connection) {
const renderedConnection = this.connection as RenderedConnection;
if (this.connection && this.connection instanceof RenderedConnection) {
// Has a connection.
if (visible) {
renderList = renderedConnection.startTrackingAll();
renderList = this.connection.startTrackingAll();
} else {
renderedConnection.stopTrackingAll();
this.connection.stopTrackingAll();
}
const child = renderedConnection.targetBlock();
const child = this.connection.targetBlock();
if (child) {
child.getSvgRoot().style.display = visible ? 'block' : 'none';
}
Expand Down

0 comments on commit 04dd92a

Please sign in to comment.