Fix scrolling on github pages not working

This commit is contained in:
Matei Adriel 2023-10-29 06:52:42 +01:00
parent d6200cffef
commit 4afe680833
No known key found for this signature in database

View file

@ -81,7 +81,7 @@ export class SimulationRenderer {
public updateWheelListener(ref: RefObject<HTMLCanvasElement>) { public updateWheelListener(ref: RefObject<HTMLCanvasElement>) {
if (ref.current) { if (ref.current) {
ref.current.addEventListener('wheel', (event) => { ref.current.addEventListener('wheel', (event) => {
if (!modalIsOpen() && location.pathname === '/') { if (!modalIsOpen() && location.pathname === process.env.BASEURL) {
event.preventDefault() event.preventDefault()
handleScroll(event, this.camera) handleScroll(event, this.camera)
@ -125,9 +125,7 @@ export class SimulationRenderer {
if (!gate) { if (!gate) {
throw new SimulationError(`Cannot find gate with id ${id}`) throw new SimulationError(`Cannot find gate with id ${id}`)
} else if (!gate.data) { } else if (!gate.data) {
throw new SimulationError( throw new SimulationError(`Cannot find data of gate with id ${id}`)
`Cannot find data of gate with id ${id}`
)
} }
return gate.data return gate.data