mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-10-26 16:45:18 +00:00
Fix missing query keys
This commit is contained in:
1 parent
e9d32ff4b3
commit
cd66372169
1 file changed
+10
-2
@@ -67,6 +67,10 @@ const LibraryToolbar: FC = () => {
|
||||
const { user } = useApi();
|
||||
const canCreateCollections = user?.Policy?.IsAdministrator || user?.Policy?.EnableCollectionManagement;
|
||||
|
||||
// The query key for all items for the current user.
|
||||
// This should be used to invalidate queries that affect multiple parents, such as collections and playlists.
|
||||
const allItemsQueryKey = useMemo(() => ['User', user?.Id, 'Items'], [user?.Id]);
|
||||
|
||||
// Pagination
|
||||
const startIndex = viewSettings?.StartIndex ?? 0;
|
||||
const { libraryPageSize: paginationLimit } = useUserSettings();
|
||||
@@ -148,8 +152,12 @@ const LibraryToolbar: FC = () => {
|
||||
)}
|
||||
</ButtonGroup>
|
||||
|
||||
{isBtnNewCollectionEnabled && canCreateCollections && <NewCollectionButton isTextVisible={isSmallScreen} />}
|
||||
{isBtnNewPlaylistEnabled && <NewPlaylistButton isTextVisible={isSmallScreen} />}
|
||||
{isBtnNewCollectionEnabled && canCreateCollections && (
|
||||
<NewCollectionButton isTextVisible={isSmallScreen} queryKey={allItemsQueryKey} />
|
||||
)}
|
||||
{isBtnNewPlaylistEnabled && (
|
||||
<NewPlaylistButton isTextVisible={isSmallScreen} queryKey={allItemsQueryKey} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
Reference in new issue
Block a user