mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-07 11:09:58 +02:00
add loading state to playlist folder move
This commit is contained in:
@@ -13,6 +13,7 @@ import { ContextMenuController } from '/@/renderer/features/context-menu/context
|
||||
import { usePlayer } from '/@/renderer/features/player/context/player-context';
|
||||
import { playlistsQueries } from '/@/renderer/features/playlists/api/playlists-api';
|
||||
import { openCreatePlaylistModal } from '/@/renderer/features/playlists/components/create-playlist-form';
|
||||
import { useIsMutatingSidebarPlaylistFolderMove } from '/@/renderer/features/playlists/mutations/sidebar-playlist-folder-move-mutation';
|
||||
import {
|
||||
LONG_PRESS_PLAY_BEHAVIOR,
|
||||
PlayTooltip,
|
||||
@@ -47,6 +48,7 @@ import { ButtonProps } from '/@/shared/components/button/button';
|
||||
import { Group } from '/@/shared/components/group/group';
|
||||
import { Icon } from '/@/shared/components/icon/icon';
|
||||
import { Image } from '/@/shared/components/image/image';
|
||||
import { LoadingOverlay } from '/@/shared/components/loading-overlay/loading-overlay';
|
||||
import { Text } from '/@/shared/components/text/text';
|
||||
import { useLocalStorage } from '/@/shared/hooks/use-local-storage';
|
||||
import {
|
||||
@@ -603,6 +605,7 @@ export const SidebarPlaylistList = () => {
|
||||
);
|
||||
|
||||
const showExpandAll = folderView !== 'navigation' && folderPaths.length > 0;
|
||||
const isFolderMovePending = useIsMutatingSidebarPlaylistFolderMove();
|
||||
|
||||
return (
|
||||
<Accordion.Item value="playlists">
|
||||
@@ -674,7 +677,8 @@ export const SidebarPlaylistList = () => {
|
||||
</Group>
|
||||
</Group>
|
||||
</PlaylistRootAccordionControl>
|
||||
<Accordion.Panel>
|
||||
<Accordion.Panel className={styles.panel}>
|
||||
<LoadingOverlay pos="absolute" visible={isFolderMovePending} />
|
||||
<PlaylistFolderDragExpandProvider expandedSet={expandedSet} setMany={setMany}>
|
||||
<PlaylistFolderViews
|
||||
{...folderViewState}
|
||||
@@ -837,6 +841,8 @@ export const SidebarSharedPlaylistList = () => {
|
||||
[navigation],
|
||||
);
|
||||
|
||||
const isFolderMovePending = useIsMutatingSidebarPlaylistFolderMove();
|
||||
|
||||
if (playlistItems?.items?.length === 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -860,7 +866,8 @@ export const SidebarSharedPlaylistList = () => {
|
||||
</Text>
|
||||
</Group>
|
||||
</Accordion.Control>
|
||||
<Accordion.Panel>
|
||||
<Accordion.Panel className={styles.panel}>
|
||||
<LoadingOverlay pos="absolute" visible={isFolderMovePending} />
|
||||
<PlaylistFolderDragExpandProvider expandedSet={expandedSet} setMany={setMany}>
|
||||
<PlaylistFolderViews
|
||||
{...folderViewState}
|
||||
|
||||
Reference in New Issue
Block a user