diff options
| author | Andy Rickert <andrew_rickert@brown.edu> | 2020-04-29 16:23:30 -0700 |
|---|---|---|
| committer | Andy Rickert <andrew_rickert@brown.edu> | 2020-04-29 16:23:30 -0700 |
| commit | ddf0902be470f6557695627fc65103c2d10e42f7 (patch) | |
| tree | 38311ac28f3f253462b9f867220fdee732f7a336 /src/client/util/History.ts | |
| parent | 9aab1f5e7dc7438dfa8a93afe03bd5746315c994 (diff) | |
| parent | dadbb74ffa56a0dc55745ce972e7b13925629b7b (diff) | |
merge w master
Diffstat (limited to 'src/client/util/History.ts')
| -rw-r--r-- | src/client/util/History.ts | 6 |
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) { |
