Handle missing mutation failures

This commit is contained in:
schroda
2024-08-05 15:20:09 +02:00
parent 82bb1d7230
commit 49f1ad804f
2 changed files with 8 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ import { dateTimeFormatter, epochToDate, getDateString } from '@/util/date.ts';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
import { TypographyMaxLines } from '@/components/atoms/TypographyMaxLines.tsx';
import { ChapterIdInfo, ChapterMangaInfo } from '@/lib/data/Chapters.ts';
import { makeToast } from '@/components/util/Toast.tsx';
const groupByDate = (updates: Pick<ChapterType, 'fetchedAt'>[]): [date: string, items: number][] => {
if (!updates.length) {
@@ -102,7 +103,9 @@ export const Updates: React.FC = () => {
};
const downloadChapter = (chapter: ChapterIdInfo) => {
requestManager.addChapterToDownloadQueue(chapter.id);
requestManager
.addChapterToDownloadQueue(chapter.id)
.response.catch(() => makeToast(t('global.error.label.failed_to_save_changes'), 'error'));
};
const loadMore = useCallback(() => {