Handle missing mutation failures
This commit is contained in:
@@ -23,6 +23,7 @@ import { EmptyViewAbsoluteCentered } from '@/components/util/EmptyViewAbsoluteCe
|
|||||||
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
||||||
import { GetCategoriesSettingsQueryVariables, GetSourceSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
import { GetCategoriesSettingsQueryVariables, GetSourceSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||||
import { GET_SOURCE_SETTINGS } from '@/lib/graphql/queries/SourceQuery.ts';
|
import { GET_SOURCE_SETTINGS } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||||
|
import { makeToast } from '@/components/util/Toast.tsx';
|
||||||
|
|
||||||
function getPrefComponent(type: string) {
|
function getPrefComponent(type: string) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -67,7 +68,9 @@ export function SourceConfigure() {
|
|||||||
const updateValue =
|
const updateValue =
|
||||||
(position: number): PreferenceProps['updateValue'] =>
|
(position: number): PreferenceProps['updateValue'] =>
|
||||||
(type, value) => {
|
(type, value) => {
|
||||||
requestManager.setSourcePreferences(sourceId, { position, [type]: value });
|
requestManager
|
||||||
|
.setSourcePreferences(sourceId, { position, [type]: value })
|
||||||
|
.response.catch(() => makeToast(t('global.error.label.failed_to_save_changes'), 'error'));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { dateTimeFormatter, epochToDate, getDateString } from '@/util/date.ts';
|
|||||||
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
||||||
import { TypographyMaxLines } from '@/components/atoms/TypographyMaxLines.tsx';
|
import { TypographyMaxLines } from '@/components/atoms/TypographyMaxLines.tsx';
|
||||||
import { ChapterIdInfo, ChapterMangaInfo } from '@/lib/data/Chapters.ts';
|
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][] => {
|
const groupByDate = (updates: Pick<ChapterType, 'fetchedAt'>[]): [date: string, items: number][] => {
|
||||||
if (!updates.length) {
|
if (!updates.length) {
|
||||||
@@ -102,7 +103,9 @@ export const Updates: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const downloadChapter = (chapter: ChapterIdInfo) => {
|
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(() => {
|
const loadMore = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user