mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-09 05:40:53 +02:00
Fixed: UI does not always reflect series being refreshed
This commit is contained in:
parent
6f451b2206
commit
8acd154206
5 changed files with 15 additions and 12 deletions
|
|
@ -191,19 +191,21 @@ function SeriesDetails({ seriesId }: SeriesDetailsProps) {
|
|||
const isSaving = useSelector((state: AppState) => state.series.isSaving);
|
||||
|
||||
const { isRefreshing, isRenaming, isSearching } = useMemo(() => {
|
||||
const isSeriesRefreshing = isCommandExecuting(
|
||||
findCommand(commands, {
|
||||
name: commandNames.REFRESH_SERIES,
|
||||
seriesId,
|
||||
})
|
||||
);
|
||||
const seriesRefreshingCommand = findCommand(commands, {
|
||||
name: commandNames.REFRESH_SERIES,
|
||||
});
|
||||
|
||||
const isSeriesRefreshingCommandExecuting = isCommandExecuting(
|
||||
seriesRefreshingCommand
|
||||
);
|
||||
|
||||
const allSeriesRefreshing =
|
||||
isCommandExecuting(seriesRefreshingCommand) &&
|
||||
!seriesRefreshingCommand?.body.seriesId;
|
||||
isSeriesRefreshingCommandExecuting &&
|
||||
!seriesRefreshingCommand?.body.seriesIds?.length;
|
||||
|
||||
const isSeriesRefreshing =
|
||||
isSeriesRefreshingCommandExecuting &&
|
||||
seriesRefreshingCommand?.body.seriesIds?.includes(seriesId);
|
||||
|
||||
const isSearchingExecuting = isCommandExecuting(
|
||||
findCommand(commands, {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
|||
dispatch(
|
||||
executeCommand({
|
||||
name: REFRESH_SERIES,
|
||||
seriesId,
|
||||
seriesIds: [seriesId],
|
||||
})
|
||||
);
|
||||
}, [seriesId, dispatch]);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ function SeriesIndexPoster(props: SeriesIndexPosterProps) {
|
|||
dispatch(
|
||||
executeCommand({
|
||||
name: REFRESH_SERIES,
|
||||
seriesId,
|
||||
seriesIds: [seriesId],
|
||||
})
|
||||
);
|
||||
}, [seriesId, dispatch]);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ function SeriesIndexRow(props: SeriesIndexRowProps) {
|
|||
dispatch(
|
||||
executeCommand({
|
||||
name: REFRESH_SERIES,
|
||||
seriesId,
|
||||
seriesIds: [seriesId],
|
||||
})
|
||||
);
|
||||
}, [seriesId, dispatch]);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ function createSeriesIndexItemSelector(seriesId: number) {
|
|||
(series: Series, qualityProfile, executingCommands: Command[]) => {
|
||||
const isRefreshingSeries = executingCommands.some((command) => {
|
||||
return (
|
||||
command.name === REFRESH_SERIES && command.body.seriesId === seriesId
|
||||
command.name === REFRESH_SERIES &&
|
||||
command.body.seriesIds?.includes(series.id)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue