Fix manga details not updating after refresh with partial data
Regression 0ed2e7c193
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user