mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-20 22:50:11 -04:00
[ENG-1685] Fix 'ExplorerContext.Provider not found!' (#2210)
fix context
This commit is contained in:
@@ -4,7 +4,7 @@ import { useCallbackToWatchResize } from '~/hooks';
|
||||
import { useExplorerContext } from '../Context';
|
||||
|
||||
export function useSize(ref: RefObject<Element>) {
|
||||
const explorerSettings = useExplorerContext().useSettingsSnapshot();
|
||||
const explorerSettings = useExplorerContext({ suspense: false })?.useSettingsSnapshot();
|
||||
|
||||
const initialized = useRef(false);
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useSize(ref: RefObject<Element>) {
|
||||
|
||||
useEffect(() => {
|
||||
initialized.current = false;
|
||||
}, [explorerSettings.gridItemSize]);
|
||||
}, [explorerSettings?.gridItemSize]);
|
||||
|
||||
useCallbackToWatchResize(
|
||||
({ width, height }) => {
|
||||
|
||||
Reference in New Issue
Block a user