Enhance EntryTraceDialog component by refactoring data display logic into dedicated summary functions for improved readability and maintainability. Update GridTab to streamline checkbox state management with a new toggle function. Refactor RulesCard to simplify window removal logic. Adjust CollectionsPanel, GenresPanel, GroupsPanel, RolesPanel, ShowsPanel, and UsersPanel to import sorting utilities from a centralized location, enhancing code organization. Update ThemeProvider to utilize a shared theme context for better consistency across the application.
ci / build-backend (push) Successful in 2m15s
ci / build-frontend (push) Successful in 50s
ci / tests (push) Successful in 2m34s
ci / sonar (push) Successful in 6m13s

This commit is contained in:
Leonid Pershin
2026-07-27 00:25:11 +03:00
parent f4926848d7
commit 419aff54fa
26 changed files with 355 additions and 251 deletions
@@ -30,6 +30,24 @@ function readStoredAudio(): { volume: number; muted: boolean } {
return { volume: 1, muted: true }
}
/**
* Восстанавливает сохранённую громкость/mute и запускает воспроизведение; если браузер блокирует
* автоплей со звуком — откатывается на воспроизведение без звука (о чём сообщает <c>onMuted</c>).
*/
function startPlaybackWithAudio(
video: HTMLVideoElement,
audio: { volume: number; muted: boolean },
onMuted: (muted: boolean) => void,
) {
video.volume = audio.volume
video.muted = audio.muted
video.play().catch(() => {
video.muted = true
onMuted(true)
void video.play().catch(() => undefined)
})
}
/**
* HLS-плеер линейного канала. Это живой эфир: ни перемотки, ни паузы — только звук, громкость и
* полноэкранный режим. Cookie tw_stream уже выдана к монтированию.
@@ -101,18 +119,7 @@ export function ChannelPlayer({
const src = `/api/channels/${slug}/live.m3u8`
let hls: Hls | null = null
// Восстанавливаем сохранённую громкость/mute и запускаем; если браузер блокирует автоплей со
// звуком — откатываемся на воспроизведение без звука.
const startPlayback = () => {
const audio = audioRef.current
video.volume = audio.volume
video.muted = audio.muted
video.play().catch(() => {
video.muted = true
setMuted(true)
void video.play().catch(() => undefined)
})
}
const startPlayback = () => startPlaybackWithAudio(video, audioRef.current, setMuted)
// Слушатели нативной ветки — держим ссылки, чтобы снять их в cleanup (симметрично hls.destroy()).
const onNativeError = () => onUnavailable?.()