aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/History.ts
diff options
context:
space:
mode:
authorStanley Yip <stanley_yip@brown.edu>2020-04-28 18:27:17 -0700
committerStanley Yip <stanley_yip@brown.edu>2020-04-28 18:27:17 -0700
commitdfa9b765a2918e2e4613d57ac70370b2dc292726 (patch)
treefc2b3bab40fc3bac987561456fff5b1fa570aebc /src/client/util/History.ts
parent55d1ea38c1355ef97efedd6c1fbdbc29d7b5d821 (diff)
parent6b2896756c55727ed397c223187cb03fe8a51a59 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into snapper
Diffstat (limited to 'src/client/util/History.ts')
-rw-r--r--src/client/util/History.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/util/History.ts b/src/client/util/History.ts
index 545e8acb4..2c53d7e52 100644
--- a/src/client/util/History.ts
+++ b/src/client/util/History.ts
@@ -40,8 +40,12 @@ export namespace HistoryUtil {
// }
}
+ let _lastStatePush = 0;
export function pushState(state: ParsedUrl) {
- history.pushState(state, "", createUrl(state));
+ if (Date.now() - _lastStatePush > 1000) {
+ history.pushState(state, "", createUrl(state));
+ }
+ _lastStatePush = Date.now();
}
export function replaceState(state: ParsedUrl) {