Skip to content

Commit

Permalink
fix(app): not display loading when self jump
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 7, 2023
1 parent 56d74c1 commit 65f690d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/app/src/components/Loading.astro
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@
if (target) {
const href = target.getAttribute('href');
if (target.getAttribute('target') !== '_blank') {
if (href && (href.startsWith('/') || href.startsWith(window.location.origin))) {
loading.set(true);
if (href) {
if (
(href.startsWith('/') && window.location.origin + href !== window.location.href) ||
(href.startsWith(window.location.origin) && href !== window.location.href)
) {
loading.set(true);
}
}
}
}
Expand Down

0 comments on commit 65f690d

Please sign in to comment.