Add retry logic to existing error handling

This commit is contained in:
schroda
2024-04-27 22:14:42 +02:00
parent 7531edbd59
commit 58f5e9ff79
4 changed files with 42 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ import { makeToast } from '@/components/util/Toast.tsx';
import { TrackerMangaCard } from '@/components/tracker/TrackerMangaCard.tsx';
import { DIALOG_PADDING } from '@/components/tracker/constants.ts';
import { getOptionForDirection } from '@/theme.ts';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
export const TrackerSearch = ({
mangaId,
@@ -114,6 +115,9 @@ export const TrackerSearch = ({
<EmptyView
message={t('global.error.label.failed_to_load_data')}
messageExtra={trackerSearch.error.message}
retry={() =>
trackerSearch.refetch().catch(defaultPromiseErrorHandler('TrackerSearch::refetch'))
}
/>
)}
<List sx={{ padding: 0 }}>