Skip to content

Commit

Permalink
fix: remove throw Error
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarMuhamethanov committed Jan 24, 2025
1 parent a08f7e0 commit 45fff14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vkui/src/components/AppRoot/ScrollContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const GlobalScrollController = ({ children }: ScrollControllerProps): Rea
const getScroll = React.useCallback<ScrollContextInterface['getScroll']>(
(options = { compensateKeyboardHeight: true }) => {
if (!window) {
throw new Error('window is not defined');
return { x: 0, y: 0 };

Check warning on line 112 in packages/vkui/src/components/AppRoot/ScrollContext.tsx

View check run for this annotation

Codecov / codecov/patch

packages/vkui/src/components/AppRoot/ScrollContext.tsx#L112

Added line #L112 was not covered by tests
}
const bodyStyles = document!.body.style;
const [scrollLeft, scrollTop] = scrollLockEnabledRef.current
Expand Down

0 comments on commit 45fff14

Please sign in to comment.