Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hashchange: Ensure no duplicate entries in browser history.

N-Shar-mace68911ab222
diff --git a/web/src/hashchange.js b/web/src/hashchange.js
index 4cb6b08c534..7acfcbd8486 100644
--- a/web/src/hashchange.js
+++ b/web/src/hashchange.js
@@ -51,6 +51,10 @@ function get_full_url(hash) {
}
function set_hash(hash) {
+ if (hash === window.location.hash) {
+ // Avoid adding duplicate entries in browser history.
+ return;
+ }
if (history.pushState) {
const url = get_full_url(hash);
history.pushState(null, null, url);