Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing thrown errors fixed the closing problem #2425

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/tiles/geometry/geometry-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,11 @@

private destroyBoard() {
const { board } = this.state;
board && JXG.JSXGraph.freeBoard(board);
try {
board && JXG.JSXGraph.freeBoard(board);
} catch (e) {
console.warn("Can't free the JSX Board", {cause: e});

Check warning on line 752 in src/components/tiles/geometry/geometry-content.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/tiles/geometry/geometry-content.tsx#L752

Added line #L752 was not covered by tests
}
}

private async initializeContent() {
Expand Down
10 changes: 6 additions & 4 deletions src/components/tiles/tile-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class TileComponent extends BaseComponent<IProps, IState> {
const tileId = this.props.model.id;
return Component != null
? <Component
key={tileId} tileElt={this.domElement} {...this.props}
key={`tile-component-${tileId}`} tileElt={this.domElement} {...this.props}
onRegisterTileApi={this.handleRegisterTileApi}
onUnregisterTileApi={this.handleUnregisterTileApi} />
: null;
Expand All @@ -264,9 +264,11 @@ export class TileComponent extends BaseComponent<IProps, IState> {
const tileApiInterface = this.context;
const tileApi = tileApiInterface?.getTileApi(model.id);
const clientTileLinks = tileApi?.getLinkedTiles?.();
return clientTileLinks
? clientTileLinks.map((id, index) => {
return <LinkIndicatorComponent key={id} id={id} index={index} />;
// There are cases where the link ids are empty strings, so we skip those
const filteredLinks = clientTileLinks?.filter(id => !!id);
return filteredLinks
? filteredLinks.map((id, index) => {
return <LinkIndicatorComponent key={`linked-tile-${id}`} id={id} index={index} />;
})
: null; // tables don't use the original link indicator any more
}
Expand Down
Loading