Update eslint (non-major) (#39797)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: diondiondion <mail@diondiondion.com>
This commit is contained in:
1 parent
4ebd3e5491
commit
54b1dd7ae3
14 files changed
+819
-278
No files matched your search
@@ -20,9 +20,11 @@ import { SpoilerButton } from 'mastodon/components/spoiler_button';
|
||||
import { formatTime, getPointerPosition } from 'mastodon/features/video';
|
||||
import { useAudioContext } from 'mastodon/hooks/useAudioContext';
|
||||
import { useAudioVisualizer } from 'mastodon/hooks/useAudioVisualizer';
|
||||
import { displayMedia, useBlurhash } from 'mastodon/initial_state';
|
||||
import { useBlurhash } from 'mastodon/initial_state';
|
||||
import { playerSettings } from 'mastodon/settings';
|
||||
|
||||
import { useRevealedMedia } from '../../hooks/useRevealedMedia';
|
||||
|
||||
import { AudioVisualizer } from './visualizer';
|
||||
|
||||
const messages = defineMessages({
|
||||
@@ -100,7 +102,7 @@ export const Audio: React.FC<{
|
||||
const [volume, setVolume] = useState(0.5);
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const [dragging, setDragging] = useState(false);
|
||||
const [revealed, setRevealed] = useState(false);
|
||||
const [revealed, setRevealed] = useRevealedMedia({ visible, sensitive });
|
||||
|
||||
const playerRef = useRef<HTMLDivElement>(null);
|
||||
const audioRef = useRef<HTMLAudioElement>(null);
|
||||
@@ -177,17 +179,6 @@ export const Audio: React.FC<{
|
||||
}
|
||||
}, [volume, muted, gainNodeRef]);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof visible !== 'undefined') {
|
||||
setRevealed(visible);
|
||||
} else {
|
||||
setRevealed(
|
||||
displayMedia === 'show_all' ||
|
||||
(displayMedia !== 'hide_all' && !sensitive),
|
||||
);
|
||||
}
|
||||
}, [visible, sensitive]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!revealed) {
|
||||
pauseAudio();
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useSpring, animated, config } from '@react-spring/web';
|
||||
import { throttle } from 'lodash';
|
||||
|
||||
import type { DeployPictureInPictureCallback } from '@/mastodon/actions/picture_in_picture';
|
||||
import { useRevealedMedia } from '@/mastodon/hooks/useRevealedMedia';
|
||||
import Forward5Icon from '@/material-icons/400-24px/forward_5-fill.svg?react';
|
||||
import FullscreenIcon from '@/material-icons/400-24px/fullscreen.svg?react';
|
||||
import FullscreenExitIcon from '@/material-icons/400-24px/fullscreen_exit.svg?react';
|
||||
@@ -28,7 +29,7 @@ import {
|
||||
attachFullscreenListener,
|
||||
detachFullscreenListener,
|
||||
} from 'mastodon/features/ui/util/fullscreen';
|
||||
import { displayMedia, useBlurhash } from 'mastodon/initial_state';
|
||||
import { useBlurhash } from 'mastodon/initial_state';
|
||||
import { playerSettings } from 'mastodon/settings';
|
||||
|
||||
import { HotkeyIndicator } from './components/hotkey_indicator';
|
||||
@@ -214,7 +215,7 @@ export const Video: React.FC<{
|
||||
const [fullscreen, setFullscreen] = useState(false);
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const [muted, setMuted] = useState(false);
|
||||
const [revealed, setRevealed] = useState(false);
|
||||
const [revealed, setRevealed] = useRevealedMedia({ visible, sensitive });
|
||||
const [hotkeyEvents, setHotkeyEvents] = useState<HotkeyEvent[]>([]);
|
||||
|
||||
const playerRef = useRef<HTMLDivElement>(null);
|
||||
@@ -362,17 +363,6 @@ export const Video: React.FC<{
|
||||
videoRef.current.muted = muted;
|
||||
}, [volume, muted]);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof visible !== 'undefined') {
|
||||
setRevealed(visible);
|
||||
} else {
|
||||
setRevealed(
|
||||
displayMedia === 'show_all' ||
|
||||
(displayMedia !== 'hide_all' && !sensitive),
|
||||
);
|
||||
}
|
||||
}, [visible, sensitive]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!revealed && videoRef.current) {
|
||||
videoRef.current.pause();
|
||||
|
||||
Reference in new issue
Block a user