Skip to content

Commit

Permalink
add type annotations for window
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Oct 26, 2023
1 parent f089276 commit 31bc66e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/layout/navigation/navigationLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export const navigationLogic = kea<navigationLogicType>([
],
}),
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const visibilitySensorLogic = kea<visibilitySensorLogicType>([
scrolling: (element: HTMLElement) => ({ element }),
})),
windowValues({
innerHeight: (window) => window.innerHeight,
innerHeight: (window: Window) => window.innerHeight,
}),
reducers(() => ({
visible: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(
},
})),
windowValues({
isSmallScreen: (window: any) => window.innerWidth < getBreakpoint('md'),
isSmallScreen: (window: Window) => window.innerWidth < getBreakpoint('md'),
}),

beforeUnmount(({ values, actions, cache, props }) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/toolbar/button/toolbarButtonLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const toolbarButtonLogic = kea<toolbarButtonLogicType>([
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: [
Expand Down

0 comments on commit 31bc66e

Please sign in to comment.