Skip to content

Commit

Permalink
fix: update reveal version
Browse files Browse the repository at this point in the history
  • Loading branch information
christjt committed Jun 26, 2023
1 parent a20c401 commit 2100d01
Show file tree
Hide file tree
Showing 3 changed files with 494 additions and 25 deletions.
2 changes: 1 addition & 1 deletion react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@babel/preset-react": "7.22.5",
"@babel/preset-typescript": "7.22.5",
"@cognite/cogs.js": "^9.17.0",
"@cognite/reveal": "link:../viewer",
"@cognite/reveal": "4.3.4",
"@cognite/sdk": "^8.2.0",
"@storybook/addon-essentials": "7.0.22",
"@storybook/addon-interactions": "7.0.22",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { AddModelOptions, Cognite3DViewer, CogniteCadModel } from '@cognite/reveal';
import { useEffect, useRef } from "react";
import { AddModelOptions, CogniteCadModel } from '@cognite/reveal';
import { useReveal } from "../RevealContainer/RevealContext";
import { Matrix4 } from "three";

Expand All @@ -17,7 +17,7 @@ export default function CogniteCadModelContainer({ addModelOptions, transform }:
addModel(modelId, revisionId, transform)
.catch(console.error);
return () => {
if (modelRef.current === undefined || (viewer as any).isDisposed) return;
if (modelRef.current === undefined || !viewer.models.includes(modelRef.current)) return;
viewer.removeModel(modelRef.current);
modelRef.current = undefined;
}
Expand Down
Loading

0 comments on commit 2100d01

Please sign in to comment.