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