Skip to content

Commit

Permalink
Cleanup: remove unused code
Browse files Browse the repository at this point in the history
after changes in 1cd6f70 a bunch of code is not used anymore
  • Loading branch information
MonkeyDo committed Oct 21, 2024
1 parent 1cd6f70 commit 0269aa9
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions frontend/js/src/settings/missing-data/MissingMBData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function MissingMBDataPage() {
const dispatch = useBrainzPlayerDispatch();
const location = useLocation();
// Loader
const { data: loaderData } = useQuery<MissingMBDataLoaderData>(
const { data: loaderData, isLoading } = useQuery<MissingMBDataLoaderData>(
RouteQuery(["missing-data"], location.pathname)
);
const { missing_data: missingDataProps = [], last_updated: lastUpdated } =
Expand All @@ -80,7 +80,6 @@ export default function MissingMBDataPage() {
const pageSearchParam = searchParams.get("page");

// State
const [loading, setLoading] = React.useState<boolean>(false);
const [deletedListens, setDeletedListens] = React.useState<Array<string>>([]);
const [missingData, setMissingData] = React.useState<Array<MissingMBData>>(
missingDataProps
Expand Down Expand Up @@ -115,16 +114,7 @@ export default function MissingMBDataPage() {
offset + EXPECTED_ITEMS_PER_PAGE
);

// Ref
const missingMBDataTableRef = React.useRef<HTMLDivElement>(null);

// Functions
const afterDisplay = () => {
if (missingMBDataTableRef?.current) {
missingMBDataTableRef.current.scrollIntoView({ behavior: "smooth" });
}
setLoading(false);
};

const deleteListen = async (data: MissingMBData) => {
if (user?.auth_token) {
Expand Down Expand Up @@ -221,7 +211,7 @@ export default function MissingMBDataPage() {
)}
<br />
<div>
<div id="missingMBData" ref={missingMBDataTableRef}>
<div id="missingMBData">
<div
style={{
height: 0,
Expand All @@ -230,7 +220,7 @@ export default function MissingMBDataPage() {
zIndex: 1,
}}
>
<Loader isLoading={loading} />
<Loader isLoading={isLoading} />
</div>
{itemsOnThisPage.map((group) => {
const releaseName = group.at(0)?.release_name ?? null;
Expand Down

0 comments on commit 0269aa9

Please sign in to comment.