fix(Media): re-mount when `src` changed

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-07-26 19:39:51 +08:00
parent 517806af63
commit 2938b74e69
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 8 additions and 7 deletions

View File

@ -188,4 +188,4 @@ const MediaImpl: FC<MediaProps> = ({
)
}
export const Media = memo(MediaImpl)
export const Media: FC<MediaProps> = memo((props) => <MediaImpl {...props} key={props.src} />)

View File

@ -71,11 +71,12 @@ const CornerPlayerImpl = () => {
/>
<ActionIcon
className="i-mingcute-external-link-line"
onClick={() => navigateToEntry({
entryId: entry.entries.id,
feedId: feed.id,
view: FeedViewType.Audios,
})}
onClick={() =>
navigateToEntry({
entryId: entry.entries.id,
feedId: feed.id,
view: FeedViewType.Audios,
})}
label="Open Entry"
/>
</div>
@ -199,7 +200,7 @@ const PlayerProgress = () => {
onValueChange={(value) => setControlledCurrentTime(value[0])}
onValueCommit={(value) => Player.seek(value[0])}
>
<Slider.Track className="relative h-1 w-full grow rounded bg-muted group-hover:bg-theme-disabled">
<Slider.Track className="relative h-1 w-full grow rounded bg-gray-200 duration-200 group-hover:bg-gray-300 dark:bg-neutral-700 group-hover:dark:bg-neutral-600">
<Slider.Range className="absolute h-1 rounded bg-theme-accent" />
</Slider.Track>