diff --git a/frontend/src/pages/Episodes/index.tsx b/frontend/src/pages/Episodes/index.tsx
index a90eea5d3..ffea7a378 100644
--- a/frontend/src/pages/Episodes/index.tsx
+++ b/frontend/src/pages/Episodes/index.tsx
@@ -102,7 +102,7 @@ const SeriesEpisodesView: FunctionComponent = () => {
return ;
}
- let [state, setState] = useState({
+ const [state, setState] = useState({
expand: false,
buttonText: "Expand All",
initial: true,
diff --git a/frontend/src/pages/Episodes/table.tsx b/frontend/src/pages/Episodes/table.tsx
index 956c1c8c0..77f503483 100644
--- a/frontend/src/pages/Episodes/table.tsx
+++ b/frontend/src/pages/Episodes/table.tsx
@@ -226,12 +226,12 @@ const Table: FunctionComponent = ({
// make sure season 0 is collapsed
instance.current.toggleRowExpanded([`season:0`], false);
} else {
- if (expand != undefined) {
+ if (expand !== undefined) {
instance.current.toggleAllRowsExpanded(expand);
}
}
}
- }, [maxSeason, expand]);
+ }, [maxSeason, expand, initial]);
return (