diff --git a/src/components/Attachments/AttachmentView/index.tsx b/src/components/Attachments/AttachmentView/index.tsx index 1281c017308d..5c1a91563187 100644 --- a/src/components/Attachments/AttachmentView/index.tsx +++ b/src/components/Attachments/AttachmentView/index.tsx @@ -1,9 +1,8 @@ import {Str} from 'expensify-common'; -import React, {memo, useContext, useEffect, useState} from 'react'; +import React, {memo, useEffect, useState} from 'react'; import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native'; import {View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; -import AttachmentCarouselPagerContext from '@components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext'; import type {Attachment, AttachmentSource} from '@components/Attachments/types'; import DistanceEReceipt from '@components/DistanceEReceipt'; import EReceipt from '@components/EReceipt'; @@ -23,6 +22,7 @@ import * as FileUtils from '@libs/fileDownload/FileUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import type {ColorValue} from '@styles/utils/types'; import variables from '@styles/variables'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import AttachmentViewImage from './AttachmentViewImage'; import AttachmentViewPdf from './AttachmentViewPdf'; @@ -108,7 +108,6 @@ function AttachmentView({ const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`); const {translate} = useLocalize(); const {updateCurrentlyPlayingURL} = usePlaybackContext(); - const attachmentCarouselPagerContext = useContext(AttachmentCarouselPagerContext); const theme = useTheme(); const styles = useThemeStyles(); @@ -117,7 +116,6 @@ function AttachmentView({ const [isHighResolution, setIsHighResolution] = useState(false); const [hasPDFFailedToLoad, setHasPDFFailedToLoad] = useState(false); const isVideo = (typeof source === 'string' && Str.isVideo(source)) || (file?.name && Str.isVideo(file.name)); - const isUsedInCarousel = !!attachmentCarouselPagerContext?.pagerRef; useEffect(() => { if (!isFocused && !(file && isUsedInAttachmentModal)) { @@ -290,7 +288,7 @@ function AttachmentView({ return ( source.startsWith(prefix))} isHovered={isHovered} duration={duration} /> diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/VideoRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/VideoRenderer.tsx index ad7ea87f4c9b..bcf696d00713 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/VideoRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/VideoRenderer.tsx @@ -4,7 +4,6 @@ import {AttachmentContext} from '@components/AttachmentContext'; import {isDeletedNode} from '@components/HTMLEngineProvider/htmlEngineUtils'; import {ShowContextMenuContext} from '@components/ShowContextMenuContext'; import VideoPlayerPreview from '@components/VideoPlayerPreview'; -import useCurrentReportID from '@hooks/useCurrentReportID'; import * as FileUtils from '@libs/fileDownload/FileUtils'; import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot'; import Navigation from '@navigation/Navigation'; @@ -25,7 +24,6 @@ function VideoRenderer({tnode, key}: VideoRendererProps) { const width = Number(htmlAttribs[CONST.ATTACHMENT_THUMBNAIL_WIDTH_ATTRIBUTE]); const height = Number(htmlAttribs[CONST.ATTACHMENT_THUMBNAIL_HEIGHT_ATTRIBUTE]); const duration = Number(htmlAttribs[CONST.ATTACHMENT_DURATION_ATTRIBUTE]); - const currentReportIDValue = useCurrentReportID(); const isDeleted = isDeletedNode(tnode); return ( @@ -36,7 +34,7 @@ function VideoRenderer({tnode, key}: VideoRendererProps) {