Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -49,18 +49,18 @@ export const enableViewTransitionsForNavigation = (): void => {
|
||||
// Intercept link clicks and navigation to add view transitions
|
||||
const handleLinkClick = (event: MouseEvent) => {
|
||||
const target = (event.target as HTMLElement).closest('a');
|
||||
|
||||
|
||||
if (!target) return;
|
||||
if (target.target === '_blank') return;
|
||||
if (target.origin !== window.location.origin) return;
|
||||
if (event.metaKey || event.ctrlKey || event.shiftKey) return;
|
||||
|
||||
const url = new URL(target.href);
|
||||
|
||||
|
||||
// Only handle same-origin navigation
|
||||
if (url.origin === window.location.origin) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
withViewTransition(() => {
|
||||
window.history.pushState({}, '', target.href);
|
||||
window.dispatchEvent(new PopStateEvent('popstate'));
|
||||
|
||||
Reference in New Issue
Block a user