mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use react-query for UserViews queries
This commit is contained in:
parent
f8719b8c5a
commit
92358de0b6
8 changed files with 196 additions and 89 deletions
|
@ -1,5 +1,10 @@
|
|||
|
||||
import escapeHtml from 'escape-html';
|
||||
|
||||
import { getUserViewsQuery } from 'hooks/useUserViews';
|
||||
import { toApi } from 'utils/jellyfin-apiclient/compat';
|
||||
import { queryClient } from 'utils/query/queryClient';
|
||||
|
||||
import layoutManager from '../layoutManager';
|
||||
import focusManager from '../focusManager';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
@ -291,7 +296,12 @@ function loadForm(context, user, userSettings, apiClient) {
|
|||
|
||||
updateHomeSectionValues(context, userSettings);
|
||||
|
||||
const promise1 = apiClient.getUserViews({ IncludeHidden: true }, user.Id);
|
||||
const promise1 = queryClient
|
||||
.fetchQuery(getUserViewsQuery(
|
||||
toApi(apiClient),
|
||||
user.Id,
|
||||
{ includeHidden: true }
|
||||
));
|
||||
const promise2 = apiClient.getJSON(apiClient.getUrl(`Users/${user.Id}/GroupingOptions`));
|
||||
|
||||
Promise.all([promise1, promise2]).then(responses => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue