Enables ContextIsolation

This commit is contained in:
Josh Perez 2023-01-12 19:24:59 -05:00 committed by GitHub
parent 4bbf5eb5d4
commit 9374832ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 1009 additions and 1073 deletions

View file

@ -16,6 +16,7 @@ import {
} from '../../types/Attachment';
import * as Errors from '../../types/errors';
import * as log from '../../logging/log';
import { useReducedMotion } from '../../hooks/useReducedMotion';
const MAX_GIF_REPEAT = 4;
const MAX_GIF_TIME = 8;
@ -28,8 +29,6 @@ export type Props = {
readonly i18n: LocalizerType;
readonly theme?: ThemeType;
readonly reducedMotion?: boolean;
onError(): void;
showVisualAttachment(): void;
kickOffAttachmentDownload(): void;
@ -46,16 +45,12 @@ export function GIF(props: Props): JSX.Element {
i18n,
theme,
reducedMotion = Boolean(
window.Accessibility && window.Accessibility.reducedMotionSetting
),
onError,
showVisualAttachment,
kickOffAttachmentDownload,
} = props;
const tapToPlay = reducedMotion;
const tapToPlay = useReducedMotion();
const videoRef = useRef<HTMLVideoElement | null>(null);
const { height, width } = getImageDimensions(attachment, size);