Fix query not setting properly on render after save
This commit is contained in:
parent
4058ab7491
commit
9a809a61dd
2 changed files with 9 additions and 1 deletions
|
@ -125,6 +125,12 @@ export const PlaylistDetailSongListContent = ({ tableRef }: PlaylistDetailConten
|
|||
[filters, pagination.scrollOffset, playlistId, queryClient, server],
|
||||
);
|
||||
|
||||
const handleGridSizeChange = () => {
|
||||
if (page.table.autoFit) {
|
||||
tableRef?.current?.api.sizeColumnsToFit();
|
||||
}
|
||||
};
|
||||
|
||||
const onPaginationChanged = useCallback(
|
||||
(event: PaginationChangedEvent) => {
|
||||
if (!isPaginationEnabled || !event.api) return;
|
||||
|
@ -211,6 +217,7 @@ export const PlaylistDetailSongListContent = ({ tableRef }: PlaylistDetailConten
|
|||
onColumnMoved={handleColumnChange}
|
||||
onColumnResized={debouncedColumnChange}
|
||||
onGridReady={onGridReady}
|
||||
onGridSizeChanged={handleGridSizeChange}
|
||||
onPaginationChanged={onPaginationChanged}
|
||||
onRowDoubleClicked={handleRowDoubleClick}
|
||||
/>
|
||||
|
|
|
@ -16,7 +16,7 @@ import { useDeletePlaylist } from '/@/renderer/features/playlists/mutations/dele
|
|||
import { Button, Paper, Text, toast, VirtualGridContainer } from '/@/renderer/components';
|
||||
import { SaveAsPlaylistForm } from '/@/renderer/features/playlists/components/save-as-playlist-form';
|
||||
import { useCurrentServer } from '/@/renderer/store';
|
||||
import { ServerType, SongListSort, SortOrder } from '/@/renderer/api/types';
|
||||
import { ServerType, SongListSort } from '/@/renderer/api/types';
|
||||
|
||||
const PlaylistDetailSongListRoute = () => {
|
||||
const navigate = useNavigate();
|
||||
|
@ -178,6 +178,7 @@ const PlaylistDetailSongListRoute = () => {
|
|||
<Text>Query Editor</Text>
|
||||
</Group>
|
||||
<PlaylistQueryBuilder
|
||||
key={JSON.stringify(detailQuery?.data?.rules)}
|
||||
isSaving={createPlaylistMutation?.isLoading}
|
||||
limit={detailQuery?.data?.rules?.limit}
|
||||
query={detailQuery?.data?.rules}
|
||||
|
|
Reference in a new issue