Fixed: UI does not always reflect series being refreshed

pull/7727/head
Mark McDowall 1 month ago
parent 6f451b2206
commit 8acd154206

@ -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…
Cancel
Save