From 31bc66e635cd1852ec2e4befefa2abd7bebb5277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Thu, 26 Oct 2023 21:57:54 +0200 Subject: [PATCH] add type annotations for window --- frontend/src/layout/navigation/navigationLogic.ts | 4 ++-- .../lib/components/VisibilitySensor/visibilitySensorLogic.tsx | 2 +- .../session-recordings/player/sessionRecordingPlayerLogic.ts | 2 +- frontend/src/toolbar/button/toolbarButtonLogic.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/layout/navigation/navigationLogic.ts b/frontend/src/layout/navigation/navigationLogic.ts index 91941c4de7e24..5fa4fa296b86e 100644 --- a/frontend/src/layout/navigation/navigationLogic.ts +++ b/frontend/src/layout/navigation/navigationLogic.ts @@ -60,8 +60,8 @@ export const navigationLogic = kea([ ], }), windowValues(() => ({ - fullscreen: (window) => !!window.document.fullscreenElement, - mobileLayout: (window) => window.innerWidth < 992, // Sync width threshold with Sass variable $lg! + fullscreen: (window: Window) => !!window.document.fullscreenElement, + mobileLayout: (window: Window) => window.innerWidth < 992, // Sync width threshold with Sass variable $lg! })), reducers({ // Non-mobile base diff --git a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx index 5bdf71a6d7fac..ce0bdf419953d 100644 --- a/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx +++ b/frontend/src/lib/components/VisibilitySensor/visibilitySensorLogic.tsx @@ -16,7 +16,7 @@ export const visibilitySensorLogic = kea([ scrolling: (element: HTMLElement) => ({ element }), })), windowValues({ - innerHeight: (window) => window.innerHeight, + innerHeight: (window: Window) => window.innerHeight, }), reducers(() => ({ visible: [ diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts index 15b2b31a5187f..301f1d48e8dfe 100644 --- a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts +++ b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts @@ -963,7 +963,7 @@ export const sessionRecordingPlayerLogic = kea( }, })), windowValues({ - isSmallScreen: (window: any) => window.innerWidth < getBreakpoint('md'), + isSmallScreen: (window: Window) => window.innerWidth < getBreakpoint('md'), }), beforeUnmount(({ values, actions, cache, props }) => { diff --git a/frontend/src/toolbar/button/toolbarButtonLogic.ts b/frontend/src/toolbar/button/toolbarButtonLogic.ts index 3c7cf756a5449..f8d34f07ba4aa 100644 --- a/frontend/src/toolbar/button/toolbarButtonLogic.ts +++ b/frontend/src/toolbar/button/toolbarButtonLogic.ts @@ -30,8 +30,8 @@ export const toolbarButtonLogic = kea([ setHedgehogActor: (actor: HedgehogActor) => ({ actor }), })), windowValues(() => ({ - windowHeight: (window) => window.innerHeight, - windowWidth: (window) => Math.min(window.innerWidth, window.document.body.clientWidth), + windowHeight: (window: Window) => window.innerHeight, + windowWidth: (window: Window) => Math.min(window.innerWidth, window.document.body.clientWidth), })), reducers(() => ({ heatmapInfoVisible: [