Fix manga details not updating after refresh with partial data

Regression 0ed2e7c193
This commit is contained in:
schroda
2026-05-02 14:40:10 +02:00
parent 5485f2bb0f
commit c068f2fb35
3 changed files with 15 additions and 6 deletions

View File

@@ -19,14 +19,22 @@ export const useRefreshManga = (mangaId: string) => {
setFetchingOnline(true); setFetchingOnline(true);
setError(null); setError(null);
try { const handleError = (e: unknown) => {
await requestManager.refreshManga(mangaId, { awaitRefetchQueries: true }).response;
} catch (e) {
if (CombinedGraphQLErrors.is(e) && baseCleanup(e.message) === 'no chapters found') { if (CombinedGraphQLErrors.is(e) && baseCleanup(e.message) === 'no chapters found') {
return; return;
} }
setError(e); setError(e);
};
try {
const { error: tmpError } = await requestManager.refreshManga(mangaId, {
awaitRefetchQueries: true,
}).response;
handleError(tmpError);
} catch (e) {
handleError(e);
} finally { } finally {
setFetchingOnline(false); setFetchingOnline(false);
} }

View File

@@ -700,8 +700,9 @@ export class MigrationManager {
return (async () => { return (async () => {
try { try {
const updatedMatch = await requestManager.refreshManga(match.id, { awaitRefetchQueries: true }) const updatedMatch = await requestManager.refreshManga(match.id, {
.response; awaitRefetchQueries: true,
}).response;
return updatedMatch.data?.fetchManga?.manga ?? match; return updatedMatch.data?.fetchManga?.manga ?? match;
} catch (e) { } catch (e) {

View File

@@ -2231,7 +2231,7 @@ export class RequestManager {
{ {
id: Number(mangaId), id: Number(mangaId),
}, },
{ refetchQueries: [GET_CHAPTERS_MANGA], ...options }, { refetchQueries: [GET_CHAPTERS_MANGA], errorPolicy: 'all', ...options },
); );
} }