Skip to content

Commit 82de450

Browse files
committed
feat: scroll to active track
1 parent efa3818 commit 82de450

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/mobile/app/(tabs)/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Track } from '@flow/core'
22
import { playerController, useDisplayTrack } from '@flow/player'
33
import { useTrackStore } from '@flow/store'
44
import { FlashList } from '@shopify/flash-list'
5-
import { useCallback, useRef } from 'react'
5+
import { useCallback, useEffect, useRef } from 'react'
66
import { StyleSheet, View } from 'react-native'
77
import { IconButton, Text } from 'react-native-paper'
88
import { MINI_HEIGHT } from '@/constants/Player'
@@ -33,6 +33,12 @@ export default function HomeScreen() {
3333
}
3434
}, [activeTrack, tracks])
3535

36+
useEffect(() => {
37+
if (activeTrack) {
38+
handleTargetPress()
39+
}
40+
}, [activeTrack, handleTargetPress])
41+
3642
return (
3743
<>
3844
{

0 commit comments

Comments
 (0)