From 009da032367411ddb54f165403d5a83de35a93c4 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 14 Sep 2024 01:37:36 +0200 Subject: [PATCH] Fix open track settings on library manga track action Was never properly implemented, thus, didn't work at all and instead only an empty dialog was shown --- src/components/tracker/TrackManga.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/tracker/TrackManga.tsx b/src/components/tracker/TrackManga.tsx index 91e9bc72..31f2da9a 100644 --- a/src/components/tracker/TrackManga.tsx +++ b/src/components/tracker/TrackManga.tsx @@ -59,6 +59,15 @@ export const TrackManga = ({ manga }: { manga: MangaIdInfo & Pick (isSearchActive ? Box : DialogContent), [isSearchActive]); + const loading = trackerList.loading || mangaTrackRecordsList.loading; + const error = trackerList.error ?? mangaTrackRecordsList.error; + + useEffect(() => { + if (!loading && !error && !trackersInUse.length && !loggedInTrackers.length) { + navigate('/settings/trackingSettings'); + } + }, [loading]); + useEffect(() => { Promise.all( mangaTrackRecords.map((trackRecord) => requestManager.fetchTrackBind(trackRecord.id).response), @@ -90,7 +99,6 @@ export const TrackManga = ({ manga }: { manga: MangaIdInfo & Pick; } - if (!loggedInTrackers) { - navigate('/settings/trackingSettings'); - } - if (!isSearchActive) { return (