Skip to content

Commit

Permalink
Bug Fix: unexpected error if onHover event was undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmas committed Jan 5, 2024
1 parent 991da68 commit 6376eb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function onSelectedSatChange (satellite: Record<string, any>) {
function onSatHover (event: any) {
const {
satId, satX, satY, satellite
} = event;
} = event || {};

if (!satId || satId === -1) {
setHtml('#sat-hoverbox', '(none)');
Expand Down
1 change: 1 addition & 0 deletions src/viewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class Viewer {
document
.querySelector(this.config.canvasSelector)
?.appendChild(this.renderer.domElement);
logger.debug(`Using WebGL 2: ${this.renderer.capabilities.isWebGL2}`);

this.controls = new OrbitControls(this.camera, this.renderer.domElement);
this.controls.rotateSpeed = 0.33;
Expand Down

0 comments on commit 6376eb8

Please sign in to comment.