no log: Fix a issue that cause notifier not update properly

pull/1515/head
LASER-Yi 3 years ago
parent 877368a4af
commit ea23c6acc9

@ -37,7 +37,7 @@ const defaultSite: Site = {
progress: [],
notifier: {
content: null,
timestamp: String(Date.now),
timestamp: String(Date.now()),
},
notifications: [],
sidebar: "",
@ -111,7 +111,7 @@ const reducer = createReducer(defaultSite, (builder) => {
builder.addCase(siteUpdateNotifier, (state, action) => {
state.notifier.content = action.payload;
state.notifier.timestamp = String(Date.now);
state.notifier.timestamp = String(Date.now());
});
builder

@ -84,9 +84,9 @@ const NotificationCenter: FunctionComponent = () => {
useEffect(() => {
if (hasError) {
setBtnState(State.Failed);
} else if (totalProgress > 0) {
} else if (totalProgress > 0 && totalProgress < 1.0) {
setBtnState(State.Working);
} else if (totalProgress <= 0) {
} else {
setBtnState(State.Idle);
}
}, [totalProgress, hasError]);

@ -69,9 +69,10 @@ const SeriesEpisodesView: FunctionComponent<Props> = (props) => {
const profile = useProfileBy(series.content?.profileId);
const hasTask = useIsAnyTaskRunningWithId(
episodes.content.map((v) => v.sonarrEpisodeId)
);
const hasTask = useIsAnyTaskRunningWithId([
...episodes.content.map((v) => v.sonarrEpisodeId),
id,
]);
if (isNaN(id) || !valid) {
return <Redirect to={RouterEmptyPath}></Redirect>;

Loading…
Cancel
Save