From e6f68552b1cbb86fc3a5c9b8d569468badf2e033 Mon Sep 17 00:00:00 2001 From: skalthoff <32023561+skalthoff@users.noreply.github.com> Date: Tue, 25 Nov 2025 04:09:50 -0800 Subject: [PATCH] refactor: replace MINIPLAYER_UPDATE_INTERVAL with UPDATE_INTERVAL and adjust duration rounding (#722) * refactor: replace MINIPLAYER_UPDATE_INTERVAL with UPDATE_INTERVAL and adjust duration rounding * removing miniplayer update interval config value makes the miniplayer track progress match the player track progress --------- Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> --- src/components/Player/mini-player.tsx | 10 +++++----- src/player/config.ts | 10 ---------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/components/Player/mini-player.tsx b/src/components/Player/mini-player.tsx index 32509e9c..ea616db1 100644 --- a/src/components/Player/mini-player.tsx +++ b/src/components/Player/mini-player.tsx @@ -6,7 +6,7 @@ import TextTicker from 'react-native-text-ticker' import PlayPauseButton from './components/buttons' import { TextTickerConfig } from './component.config' import { RunTimeSeconds } from '../Global/helpers/time-codes' -import { MINIPLAYER_UPDATE_INTERVAL } from '../../player/config' +import { UPDATE_INTERVAL } from '../../player/config' import { Progress as TrackPlayerProgress } from 'react-native-track-player' import { useProgress } from '../../providers/Player/hooks/queries' @@ -171,7 +171,7 @@ function MiniPlayerRuntime({ duration }: { duration: number }): React.JSX.Elemen - {Math.max(0, Math.floor(duration))} + {Math.max(0, Math.round(duration))} @@ -180,13 +180,13 @@ function MiniPlayerRuntime({ duration }: { duration: number }): React.JSX.Elemen } function MiniPlayerRuntimePosition(): React.JSX.Element { - const { position } = useProgress(MINIPLAYER_UPDATE_INTERVAL) + const { position } = useProgress(UPDATE_INTERVAL) - return {Math.max(0, Math.floor(position))} + return {Math.max(0, Math.round(position))} } function MiniPlayerProgress(): React.JSX.Element { - const progress = useProgress(MINIPLAYER_UPDATE_INTERVAL) + const progress = useProgress(UPDATE_INTERVAL) return (