mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 02:16:39 +02:00
fix: preserve infinite list cache on component remount (fixes random sort reshuffling) (#2097)
* fix: preserve infinite list cache on component remount When browsing with random sort, navigating to a detail view and coming back would reshuffle the list. This happens because the list component unmounts, losing its internal ref guard, and the reset effect re-fetches all pages — returning a new random order from the server.
This commit is contained in:
@@ -465,6 +465,8 @@ export const tagListSortMap: TagListSortMap = {
|
||||
},
|
||||
};
|
||||
|
||||
export const SortKeyRandom = 'random';
|
||||
|
||||
export enum AlbumListSort {
|
||||
ALBUM_ARTIST = 'albumArtist',
|
||||
ARTIST = 'artist',
|
||||
@@ -476,7 +478,7 @@ export enum AlbumListSort {
|
||||
ID = 'id',
|
||||
NAME = 'name',
|
||||
PLAY_COUNT = 'playCount',
|
||||
RANDOM = 'random',
|
||||
RANDOM = SortKeyRandom,
|
||||
RATING = 'rating',
|
||||
RECENTLY_ADDED = 'recentlyAdded',
|
||||
RECENTLY_PLAYED = 'recentlyPlayed',
|
||||
@@ -598,7 +600,7 @@ export enum SongListSort {
|
||||
ID = 'id',
|
||||
NAME = 'name',
|
||||
PLAY_COUNT = 'playCount',
|
||||
RANDOM = 'random',
|
||||
RANDOM = SortKeyRandom,
|
||||
RATING = 'rating',
|
||||
RECENTLY_ADDED = 'recentlyAdded',
|
||||
RECENTLY_PLAYED = 'recentlyPlayed',
|
||||
@@ -725,7 +727,7 @@ export enum AlbumArtistListSort {
|
||||
FAVORITED = 'favorited',
|
||||
NAME = 'name',
|
||||
PLAY_COUNT = 'playCount',
|
||||
RANDOM = 'random',
|
||||
RANDOM = SortKeyRandom,
|
||||
RATING = 'rating',
|
||||
RECENTLY_ADDED = 'recentlyAdded',
|
||||
RELEASE_DATE = 'releaseDate',
|
||||
@@ -814,7 +816,7 @@ export enum ArtistListSort {
|
||||
FAVORITED = 'favorited',
|
||||
NAME = 'name',
|
||||
PLAY_COUNT = 'playCount',
|
||||
RANDOM = 'random',
|
||||
RANDOM = SortKeyRandom,
|
||||
RATING = 'rating',
|
||||
RECENTLY_ADDED = 'recentlyAdded',
|
||||
RELEASE_DATE = 'releaseDate',
|
||||
|
||||
Reference in New Issue
Block a user