summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2024-10-08 15:23:39 +0200
committerOskar <oskar@mullvad.net>2024-10-22 15:18:10 +0200
commit1666ff934d648dc88f213a90dde96b1b0eca7692 (patch)
tree98ca27b363648769cfb1e41ddab503c72172e088 /gui/src
parent411a5eedc83e1b43ebe48c05b382c54105d0a029 (diff)
downloadmullvadvpn-1666ff934d648dc88f213a90dde96b1b0eca7692.tar.xz
mullvadvpn-1666ff934d648dc88f213a90dde96b1b0eca7692.zip
Prohibit @ts-ignore comments and update codebase to not use it
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/renderer/components/Accordion.tsx3
-rw-r--r--gui/src/renderer/lib/3dmap.ts4
2 files changed, 4 insertions, 3 deletions
diff --git a/gui/src/renderer/components/Accordion.tsx b/gui/src/renderer/components/Accordion.tsx
index 70ae35c988..27a5be53bc 100644
--- a/gui/src/renderer/components/Accordion.tsx
+++ b/gui/src/renderer/components/Accordion.tsx
@@ -93,7 +93,8 @@ export default class Accordion extends React.Component<IProps, IState> {
private collapse() {
// First change height to height in px since it's not possible to transition to/from auto
this.setState({ containerHeight: this.getContentHeight() + 'px' }, () => {
- // Make sure new height has been applied
+ // Make sure new height has been applied. By reading offsetHeight we force the browser to
+ // apply the height before returning.
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
this.containerRef.current?.offsetHeight;
this.setState({ containerHeight: '0' });
diff --git a/gui/src/renderer/lib/3dmap.ts b/gui/src/renderer/lib/3dmap.ts
index ec4def0744..d0e130e4c8 100644
--- a/gui/src/renderer/lib/3dmap.ts
+++ b/gui/src/renderer/lib/3dmap.ts
@@ -666,8 +666,8 @@ function getProjectionMatrix(gl: WebGL2RenderingContext): mat4 {
// Create a perspective matrix, a special matrix that is
// used to simulate the distortion of perspective in a camera.
const fieldOfView = (angleOfView / 180) * Math.PI; // in radians
- // @ts-ignore
- const aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;
+ const canvas = gl.canvas as HTMLCanvasElement;
+ const aspect = canvas.clientWidth / canvas.clientHeight;
const zNear = 0.1;
const zFar = 10;
const projectionMatrix = mat4.create();