mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
lint
This commit is contained in:
parent
5234c9daa6
commit
568cda1288
@ -7,9 +7,7 @@ import {
|
|||||||
determineAutoZoom,
|
determineAutoZoom,
|
||||||
DEFAULT_FALLBACK_ZOOM,
|
DEFAULT_FALLBACK_ZOOM,
|
||||||
DEFAULT_VISIBILITY_THRESHOLD,
|
DEFAULT_VISIBILITY_THRESHOLD,
|
||||||
measureRenderedPageRect,
|
|
||||||
useFitWidthResize,
|
useFitWidthResize,
|
||||||
ZoomViewport,
|
|
||||||
} from '@app/utils/viewerZoom';
|
} from '@app/utils/viewerZoom';
|
||||||
import { getFirstPageAspectRatioFromStub } from '@app/utils/pageMetadata';
|
import { getFirstPageAspectRatioFromStub } from '@app/utils/pageMetadata';
|
||||||
|
|
||||||
@ -73,18 +71,6 @@ export function ZoomAPIBridge() {
|
|||||||
}
|
}
|
||||||
}, [spreadMode, zoomState?.zoomLevel, scheduleAutoZoom, requestFitWidth]);
|
}, [spreadMode, zoomState?.zoomLevel, scheduleAutoZoom, requestFitWidth]);
|
||||||
|
|
||||||
const getViewportSnapshot = useCallback((): ZoomViewport | null => {
|
|
||||||
if (!zoomState || typeof zoomState !== 'object') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('viewport' in zoomState) {
|
|
||||||
const candidate = (zoomState as { viewport?: ZoomViewport | null }).viewport;
|
|
||||||
return candidate ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}, [zoomState]);
|
|
||||||
|
|
||||||
const isManagedZoom =
|
const isManagedZoom =
|
||||||
!!zoom &&
|
!!zoom &&
|
||||||
@ -137,8 +123,6 @@ export function ZoomAPIBridge() {
|
|||||||
const pagesPerSpread = currentSpreadMode !== SpreadMode.None ? 2 : 1;
|
const pagesPerSpread = currentSpreadMode !== SpreadMode.None ? 2 : 1;
|
||||||
const metadataAspectRatio = getFirstPageAspectRatioFromStub(firstFileStub);
|
const metadataAspectRatio = getFirstPageAspectRatioFromStub(firstFileStub);
|
||||||
|
|
||||||
const viewport = getViewportSnapshot();
|
|
||||||
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -185,7 +169,6 @@ export function ZoomAPIBridge() {
|
|||||||
firstFileId,
|
firstFileId,
|
||||||
firstFileStub,
|
firstFileStub,
|
||||||
requestFitWidth,
|
requestFitWidth,
|
||||||
getViewportSnapshot,
|
|
||||||
autoZoomTick,
|
autoZoomTick,
|
||||||
spreadMode,
|
spreadMode,
|
||||||
triggerImmediateZoomUpdate,
|
triggerImmediateZoomUpdate,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user