mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
all state migrated to zustand, jotai removed
splash page now waits on state hydration from db
This commit is contained in:
17
app/components/ProgressHook.tsx
Normal file
17
app/components/ProgressHook.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useStore } from '@app/state/store'
|
||||
import { selectTrackPlayer } from '@app/state/trackplayer'
|
||||
import React, { useEffect } from 'react'
|
||||
import { useProgress } from 'react-native-track-player'
|
||||
|
||||
const ProgressHook = () => {
|
||||
const setProgress = useStore(selectTrackPlayer.setProgress)
|
||||
const progress = useProgress(250)
|
||||
|
||||
useEffect(() => {
|
||||
setProgress(progress)
|
||||
}, [setProgress, progress])
|
||||
|
||||
return <></>
|
||||
}
|
||||
|
||||
export default ProgressHook
|
||||
Reference in New Issue
Block a user