Skip to content

Commit 931b8d6

Browse files
bartlomiejuclaude
andcommitted
fix: update history only after partials apply successfully
Move maybeUpdateHistory() after applyPartials() so that when a redirect falls back to full navigation, we don't leave a duplicate history entry that requires pressing back twice. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 80aa980 commit 931b8d6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/fresh/src/runtime/client/partials.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,6 @@ async function fetchPartials(
297297
}
298298
}
299299

300-
if (shouldNavigate) {
301-
maybeUpdateHistory(actualUrl);
302-
}
303-
304300
try {
305301
await applyPartials(res);
306302
} catch (err) {
@@ -312,6 +308,10 @@ async function fetchPartials(
312308
}
313309
throw err;
314310
}
311+
312+
if (shouldNavigate) {
313+
maybeUpdateHistory(actualUrl);
314+
}
315315
}
316316

317317
interface PartialReviveCtx {

0 commit comments

Comments
 (0)