mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-11 07:12:44 +01:00
don't reset parts manually, do it all at once
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import GradientFlatList from '@app/components/GradientFlatList'
|
||||
import ListItem from '@app/components/ListItem'
|
||||
import { useFetchList } from '@app/hooks/list'
|
||||
import { useFetchList, useFetchList2 } from '@app/hooks/list'
|
||||
import { PlaylistListItem } from '@app/models/music'
|
||||
import { selectMusic } from '@app/state/music'
|
||||
import { useStore } from '@app/state/store'
|
||||
import React from 'react'
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import { StyleSheet } from 'react-native'
|
||||
|
||||
const PlaylistRenderItem: React.FC<{ item: PlaylistListItem }> = ({ item }) => (
|
||||
@@ -12,12 +12,13 @@ const PlaylistRenderItem: React.FC<{ item: PlaylistListItem }> = ({ item }) => (
|
||||
)
|
||||
|
||||
const PlaylistsList = () => {
|
||||
const fetchPlaylists = useStore(selectMusic.fetchPlaylists)
|
||||
const { list, refreshing, refresh } = useFetchList(fetchPlaylists)
|
||||
const fetchPlaylists = useStore(store => store.fetchLibraryPlaylists)
|
||||
const { refreshing, refresh } = useFetchList2(fetchPlaylists)
|
||||
const playlists = useStore(store => store.entities.playlists)
|
||||
|
||||
return (
|
||||
<GradientFlatList
|
||||
data={list}
|
||||
data={Object.values(playlists)}
|
||||
renderItem={PlaylistRenderItem}
|
||||
keyExtractor={item => item.id}
|
||||
onRefresh={refresh}
|
||||
|
||||
Reference in New Issue
Block a user