Fix/double page mode not aborting preload image requests (#628)
* Use request manager to preload images in DoublePagedPager
Was forgotten to update along with f852ce70e7
The requests for the preload also never got aborted
* Revoke object urls after load
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { forwardRef, useRef } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { useMediaQuery } from '@mui/material';
|
||||
@@ -67,8 +67,6 @@ export const Page = forwardRef((props: IProps, ref: any) => {
|
||||
const theme = useTheme();
|
||||
const isMobileWidth = useMediaQuery(theme.breakpoints.down('md'));
|
||||
|
||||
const imgRef = useRef<HTMLImageElement>(null);
|
||||
|
||||
const imgStyle = imageStyle(settings);
|
||||
const isDoublePageReader = ['DoubleRTL', 'DoubleLTR'].includes(settings.readerType);
|
||||
|
||||
@@ -87,7 +85,6 @@ export const Page = forwardRef((props: IProps, ref: any) => {
|
||||
src={src}
|
||||
onImageLoad={onImageLoad}
|
||||
alt={`Page #${index}`}
|
||||
imgRef={imgRef}
|
||||
spinnerStyle={{
|
||||
...imgStyle,
|
||||
height: '100vh',
|
||||
|
||||
Reference in New Issue
Block a user