fix(ui): make random albums order stick when coming back to the grid

This commit is contained in:
Deluan 2024-09-19 20:16:50 -04:00
parent d0784b6a21
commit b6433057e9

View file

@ -29,7 +29,6 @@ import albumLists, { defaultAlbumList } from './albumLists'
import config from '../config' import config from '../config'
import AlbumInfo from './AlbumInfo' import AlbumInfo from './AlbumInfo'
import ExpandInfoDialog from '../dialogs/ExpandInfoDialog' import ExpandInfoDialog from '../dialogs/ExpandInfoDialog'
import { useMemo } from 'react'
const AlbumFilter = (props) => { const AlbumFilter = (props) => {
const translate = useTranslate() const translate = useTranslate()
@ -80,6 +79,8 @@ const AlbumListTitle = ({ albumListType }) => {
return <Title subTitle={title} args={{ smart_count: 2 }} /> return <Title subTitle={title} args={{ smart_count: 2 }} />
} }
const randomStartingSeed = Math.random().toString()
const AlbumList = (props) => { const AlbumList = (props) => {
const { width } = props const { width } = props
const albumView = useSelector((state) => state.albumView) const albumView = useSelector((state) => state.albumView)
@ -89,10 +90,6 @@ const AlbumList = (props) => {
const refresh = useRefresh() const refresh = useRefresh()
useResourceRefresh('album') useResourceRefresh('album')
const randomStartingSeed = useMemo(() => {
return Math.random().toString()
}, [])
const seed = `${randomStartingSeed}-${version}` const seed = `${randomStartingSeed}-${version}`
const albumListType = location.pathname const albumListType = location.pathname