fix(ui): make random albums order stick when coming back to the grid
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user