diff --git a/CHANGELOG.md b/CHANGELOG.md index 0200a70..9326024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,18 @@ The format is based on [Keep a Changelog](https://github.com/olivierlacan/keep-a ### Removed +## [2.1.2] - 2024-03-05 + +### Added + +### Changed + +### Fixed + +- Fix `decoration`, `viewer` pages runtime error. (https://github.com/yushiang-demo/pano-to-mesh/pull/78) + +### Removed + ## [2.1.1] - 2024-03-05 ### Added @@ -225,8 +237,9 @@ Codes without pull requests won't be recorded. ### Removed -[unreleased]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.1.1...HEAD -[2.1.1]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.0.0...v2.1.0 +[unreleased]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.1.2...HEAD +[2.1.2]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.0.1...v2.1.0 [2.0.1]: https://github.com/yushiang-demo/PanoToMesh/compare/v2.0.0...v2.0.1 [2.0.0]: https://github.com/yushiang-demo/PanoToMesh/compare/v1.4.1...v2.0.0 diff --git a/apps/editors/decoration/index.js b/apps/editors/decoration/index.js index 7e8e695..aeaa970 100644 --- a/apps/editors/decoration/index.js +++ b/apps/editors/decoration/index.js @@ -120,7 +120,7 @@ const Editor = ({ data }) => { }, []); useEffect(() => { - threeRef.current.cameraControls.setEnable(mode === MODE.SELECT); + threeRef.current?.cameraControls.setEnable(mode === MODE.SELECT); }, [mode]); const focusedMedia = media[focusedIndex]; @@ -153,6 +153,8 @@ const Editor = ({ data }) => { [focusedIndex] ); + if (!panorama) return null; + return ( <> diff --git a/apps/viewer.js b/apps/viewer.js index 5991170..113c565 100644 --- a/apps/viewer.js +++ b/apps/viewer.js @@ -114,6 +114,8 @@ const Viewer = ({ data }) => { ); }); + if (!panorama) return null; + return ( <>