diff --git a/src/screens/Settings/components/Cache.tsx b/src/screens/Settings/components/Cache.tsx new file mode 100644 index 0000000..910ae1d --- /dev/null +++ b/src/screens/Settings/components/Cache.tsx @@ -0,0 +1,26 @@ +import React, { useCallback } from 'react'; +import TrackPlayer from 'react-native-track-player'; +import { SubHeader } from 'components/Typography'; +import { Text, Button } from 'react-native'; +import { THEME_COLOR } from 'CONSTANTS'; +import { useDispatch } from 'react-redux'; +import music from 'store/music'; + +export default function CacheSettings() { + const dispatch = useDispatch(); + const handleClearCache = useCallback(() => { + // Dispatch an action to reset the music subreducer state + dispatch(music.actions.reset()); + + // Also clear the TrackPlayer queue + TrackPlayer.reset(); + }, [dispatch]); + + return ( + <> + Cache + If you have updated your Jellyfin library, but the app is holding on to cached assets, you can forcefully clear the cache using this button. This will force the app to fetch the library from scratch. +