fix(tracker): restore link navigation when tracking fails

Use .finally() instead of .then() so internal link navigation is
always restored after e.preventDefault(), even if the tracking
request rejects (e.g. server down or a throwing beforeSend callback).

Fixes #4304
This commit is contained in:
Mike Cao committed 2026-05-29 10:58:11 -07:00
1 parent 10f6ee27da
commit 18b72d3008
1 file changed
+1 -1
+1 -1
View File
@@ -138,7 +138,7 @@
e.metaKey ||
(e.button && e.button === 1);
if (!external) e.preventDefault();
return trackElement(eventEl).then(() => {
return trackElement(eventEl).finally(() => {
if (!external) {
(target === '_top' ? top.location : location).href = href;
}