fix(detail): resync reaction toggle across manga navigation
The detail page component is reused across /manga/A -> /manga/B navigations (clicking a similar or recommendation card), so ReactionButtons' locally-held `current` state kept the previous manga's reaction until interacted with — a visibly wrong thumb on the new page. Re-seed `current` from the loader-supplied prop via an effect keyed on mangaId. Also fetch the homepage's two independent /me/* shelves concurrently (Promise.allSettled) instead of in series. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -311,24 +311,24 @@
|
||||
}
|
||||
await hydrateFromUrl();
|
||||
await load();
|
||||
// Fetch the "Continue reading" shelf after the catalogue so the
|
||||
// public browse path stays unauthenticated and unblocked. Returns
|
||||
// empty for guests (401 swallowed), which hides the shelf.
|
||||
try {
|
||||
const progress = await listMyReadProgressOrEmpty();
|
||||
// Fetch the personal shelves after the catalogue so the public browse
|
||||
// path stays unauthenticated and unblocked. Both are independent
|
||||
// `/me/*` calls, so fire them concurrently rather than in series.
|
||||
// Each is isolated: a failure (or 401 for guests) hides its own shelf
|
||||
// without touching the catalogue or the other shelf.
|
||||
const [progressResult, recsResult] = await Promise.allSettled([
|
||||
listMyReadProgressOrEmpty(),
|
||||
listMyRecommendations()
|
||||
]);
|
||||
if (progressResult.status === 'fulfilled') {
|
||||
// Drop finished series (read to the end, nothing new) — a
|
||||
// "Continue reading" shelf is for what's still in progress.
|
||||
continueEntries = progress.items.filter((e) => !isCaughtUp(e));
|
||||
} catch {
|
||||
// Never let a history hiccup break the catalogue — leave the
|
||||
// shelf hidden.
|
||||
continueEntries = progressResult.value.items.filter((e) => !isCaughtUp(e));
|
||||
}
|
||||
try {
|
||||
if (recsResult.status === 'fulfilled') {
|
||||
// Personal "Recommended for you" feed (empty for guests / no
|
||||
// taste signals yet → shelf hidden).
|
||||
recommendations = await listMyRecommendations();
|
||||
} catch {
|
||||
// Non-critical — leave the shelf hidden on failure.
|
||||
recommendations = recsResult.value;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user