- fixed image path for RNTP notification
- fixed overwhelming number of promises/requests generated when scrolling through artists (could still delay loading those further...)
- fixed spinner not spinning while artistInfo is fetched for image url
This commit is contained in:
austinried
2021-08-19 14:23:09 +09:00
parent a5c2aa9cf8
commit 976cd172f4
7 changed files with 93 additions and 64 deletions

View File

@@ -27,11 +27,6 @@ const ImageSource = React.memo<{ cache?: { file?: CacheFile; request?: CacheRequ
({ cache, style, imageStyle, resizeMode }) => {
const [error, setError] = useState(false)
if (error) {
console.log('error!')
console.log(cache?.file?.path)
}
let source: ImageSourcePropType
if (!error && cache?.file && !cache?.request?.promise) {
source = { uri: `file://${cache.file.path}`, cache: 'reload' }
@@ -62,7 +57,7 @@ const ImageSource = React.memo<{ cache?: { file?: CacheFile; request?: CacheRequ
const ArtistImage = React.memo<ArtistCoverArtProps>(props => {
const cache = useArtistArtFile(props.artistId, props.size)
return <ImageSource cache={cache} {...props} />
return <ImageSource cache={cache} {...props} imageStyle={{ ...styles.artistImage, ...props.imageStyle }} />
})
const CoverArtImage = React.memo<CoverArtProps>(props => {
@@ -100,6 +95,9 @@ const styles = StyleSheet.create({
width: '100%',
position: 'absolute',
},
artistImage: {
backgroundColor: 'rgba(81, 28, 99, 0.4)',
},
})
export default CoverArt