Skip to content

Commit

Permalink
fix: changed the way of getting status bar height on ios (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateki0 authored Mar 8, 2023
1 parent 2536c6c commit d42ea6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/hooks/useStatusBarHeightDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const useStatusBarHeightDetector = ({ isPortraitMode }: Props) => {
useEffect(() => {
if (Platform.OS !== 'ios') return setBarHeight(StatusBar.currentHeight ?? 0)
// handling edge case when app is opened in landscape mode and barHeight = 0
const StatusBarManagerModule = NativeStatusBarManager || StatusBarManager
const StatusBarManagerModule = NativeStatusBarManager?.default || StatusBarManager

StatusBarManagerModule.getHeight(({ height }: { height: number }) =>
StatusBarManagerModule?.getHeight(({ height }: { height: number }) =>
setBarHeight(isPortraitMode && height !== 0 ? height : 50)
)
}, [StatusBarManager, isPortraitMode])
Expand Down

0 comments on commit d42ea6c

Please sign in to comment.