fix: add useResourceRefresh hook to AlbumShow, ArtistShow, MissingFilesList, and PlaylistShow components
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -9,6 +9,7 @@ import { makeStyles } from '@material-ui/core/styles'
|
||||
import AlbumSongs from './AlbumSongs'
|
||||
import AlbumDetails from './AlbumDetails'
|
||||
import AlbumActions from './AlbumActions'
|
||||
import { useResourceRefresh } from '../common'
|
||||
|
||||
const useStyles = makeStyles(
|
||||
(theme) => ({
|
||||
@@ -25,6 +26,7 @@ const AlbumShowLayout = (props) => {
|
||||
const { loading, ...context } = useShowContext(props)
|
||||
const { record } = context
|
||||
const classes = useStyles()
|
||||
useResourceRefresh('album', 'song')
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -12,7 +12,7 @@ import subsonic from '../subsonic'
|
||||
import AlbumGridView from '../album/AlbumGridView'
|
||||
import MobileArtistDetails from './MobileArtistDetails'
|
||||
import DesktopArtistDetails from './DesktopArtistDetails'
|
||||
import { useAlbumsPerPage } from '../common/index.js'
|
||||
import { useAlbumsPerPage, useResourceRefresh } from '../common/index.js'
|
||||
|
||||
const ArtistDetails = (props) => {
|
||||
const record = useRecordContext(props)
|
||||
@@ -55,6 +55,7 @@ const ArtistShowLayout = (props) => {
|
||||
const record = useRecordContext()
|
||||
const { width } = props
|
||||
const [, perPageOptions] = useAlbumsPerPage(width)
|
||||
useResourceRefresh('artist', 'album')
|
||||
|
||||
const maxPerPage = 90
|
||||
let perPage = 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { List, SizeField } from '../common/index'
|
||||
import { List, SizeField, useResourceRefresh } from '../common/index'
|
||||
import {
|
||||
Datagrid,
|
||||
DateField,
|
||||
@@ -31,6 +31,7 @@ const MissingPagination = (props) => (
|
||||
)
|
||||
|
||||
const MissingFilesList = (props) => {
|
||||
useResourceRefresh('song')
|
||||
return (
|
||||
<List
|
||||
{...props}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { makeStyles } from '@material-ui/core/styles'
|
||||
import PlaylistDetails from './PlaylistDetails'
|
||||
import PlaylistSongs from './PlaylistSongs'
|
||||
import PlaylistActions from './PlaylistActions'
|
||||
import { Title, canChangeTracks } from '../common'
|
||||
import { Title, canChangeTracks, useResourceRefresh } from '../common'
|
||||
|
||||
const useStyles = makeStyles(
|
||||
(theme) => ({
|
||||
@@ -27,6 +27,7 @@ const PlaylistShowLayout = (props) => {
|
||||
const { loading, ...context } = useShowContext(props)
|
||||
const { record } = context
|
||||
const classes = useStyles()
|
||||
useResourceRefresh('song')
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user