File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/gitbook/src/components/PageBody Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ export function useCoverPosition(imgs: Images, y: number) {
3737
3838 // Load original image dimensions if not provided in `imgs`
3939 useLayoutEffect ( ( ) => {
40- // Check if we have dimensions from either light or dark image
41- const hasDimensions = imgs . light . size || imgs . dark ? .size ;
40+ // Check if we have dimensions from dark (if provided) or else the default light.
41+ const hasDimensions = imgs . dark ? .size || imgs . light . size ;
4242
4343 if ( hasDimensions ) {
4444 return ; // Already have dimensions
@@ -65,8 +65,8 @@ export function useCoverPosition(imgs: Images, y: number) {
6565 } , [ imgs . light , imgs . dark ] ) ;
6666
6767 // Use provided dimensions or fall back to loaded dimensions
68- // Check light first, then dark , then loaded dimensions
69- const imageDimensions = imgs . light . size ?? imgs . dark ? .size ?? loadedDimensions ;
68+ // Check dark first, then light , then loaded dimensions
69+ const imageDimensions = imgs . dark ? .size ?? imgs . light . size ?? loadedDimensions ;
7070
7171 // Calculate ratio and dimensions similar to useCoverPosition hook
7272 const ratio =
You can’t perform that action at this time.
0 commit comments