Skip to content

Commit 3d0b3df

Browse files
authored
Merge pull request #41 from smee/issue-40
[fix #40] Prevent new HTML5 history entry when clicking a link to the cur…
2 parents 958f36e + 3f4fca5 commit 3d0b3df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/accountant/core.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
(= button 0)
9494
(= host current-host)
9595
(or (not port)
96-
(= (str port) (str current-port)))
97-
(not= current-relative-href relative-href)
96+
(= (str port) (str current-port)))
9897
(path-exists? path))
99-
(set-token! history relative-href title)
98+
(when (not= current-relative-href relative-href) ;; do not add duplicate html5 history state
99+
(set-token! history relative-href title))
100100
(.preventDefault e))))))
101101

102102
(defonce nav-handler nil)

0 commit comments

Comments
 (0)