Prioritize current reader page request

This commit is contained in:
schroda
2024-11-13 14:32:41 +01:00
parent 87ee1330d4
commit 1d50edf1a1
6 changed files with 17 additions and 3 deletions

View File

@@ -30,6 +30,8 @@ interface IProps {
shouldDecode?: boolean;
useFetchApi?: boolean;
priority?: Priority;
}
export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTMLImageElement | null>) => {
@@ -41,6 +43,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTML
onImageLoad,
spinnerStyle: { small, ...spinnerStyle } = {},
imgStyle,
priority,
} = props;
const { t } = useTranslation();
@@ -66,7 +69,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTML
return () => {};
}
const imageRequest = requestManager.requestImage(src, { priority: Priority.HIGH, shouldDecode, useFetchApi });
const imageRequest = requestManager.requestImage(src, { priority, shouldDecode, useFetchApi });
let cacheTimeout: NodeJS.Timeout;
const fetchImage = async () => {