Fix TypeScript type for direct storage image flag.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b9bef5e264
commit
fd8f12a7bc
@ -35,9 +35,11 @@ export default function ImageWithFallback({
|
|||||||
useState(!hasLoadedWithAnimations);
|
useState(!hasLoadedWithAnimations);
|
||||||
|
|
||||||
const srcString = typeof props.src === 'string' ? props.src : undefined;
|
const srcString = typeof props.src === 'string' ? props.src : undefined;
|
||||||
const useDirectStorage = DIRECT_STORAGE_IMAGES &&
|
const useDirectStorage = Boolean(
|
||||||
Boolean(srcString) &&
|
DIRECT_STORAGE_IMAGES &&
|
||||||
isExternalStoragePhotoUrl(srcString!);
|
srcString &&
|
||||||
|
isExternalStoragePhotoUrl(srcString),
|
||||||
|
);
|
||||||
const displayWidth = typeof props.width === 'number' ? props.width : 640;
|
const displayWidth = typeof props.width === 'number' ? props.width : 640;
|
||||||
const directSrc = useDirectStorage && srcString && !fallbackSrc
|
const directSrc = useDirectStorage && srcString && !fallbackSrc
|
||||||
? getDirectPhotoDisplayUrl(srcString, displayWidth)
|
? getDirectPhotoDisplayUrl(srcString, displayWidth)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user