Add prioritization to image requests (#671)
In the reader the preloaded page requests were triggered before the actual page got rendered and thus, the image request of the rendered page had to wait for all the preloaded images to finish
This commit is contained in:
@@ -16,6 +16,7 @@ import RefreshIcon from '@mui/icons-material/Refresh';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
||||
import { Priority } from '@/lib/Queue.ts';
|
||||
|
||||
interface IProps {
|
||||
src: string;
|
||||
@@ -48,7 +49,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTML
|
||||
|
||||
useEffect(() => {
|
||||
let tmpImageSourceUrl: string;
|
||||
const imageRequest = requestManager.requestImage(src);
|
||||
const imageRequest = requestManager.requestImage(src, Priority.HIGH);
|
||||
let cacheTimeout: NodeJS.Timeout;
|
||||
|
||||
const fetchImage = async () => {
|
||||
|
||||
Reference in New Issue
Block a user