fixed changing activeServer

This commit is contained in:
austinried
2021-07-30 13:02:45 +09:00
parent c24f5e573d
commit 661b17f232
8 changed files with 133 additions and 77 deletions

View File

@@ -2,8 +2,9 @@ import GradientFlatList from '@app/components/GradientFlatList'
import ListItem from '@app/components/ListItem'
import { Artist } from '@app/models/music'
import { artistsAtom, artistsUpdatingAtom, useUpdateArtists } from '@app/state/music'
import { useActiveListRefresh } from '@app/state/server'
import { useAtomValue } from 'jotai/utils'
import React, { useEffect } from 'react'
import React from 'react'
import { StyleSheet } from 'react-native'
const ArtistRenderItem: React.FC<{ item: Artist }> = ({ item }) => (
@@ -15,11 +16,7 @@ const ArtistsList = () => {
const updating = useAtomValue(artistsUpdatingAtom)
const updateArtists = useUpdateArtists()
useEffect(() => {
if (artists.length === 0) {
updateArtists()
}
})
useActiveListRefresh(artists, updateArtists)
return (
<GradientFlatList