diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-24 17:23:59 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-24 17:23:59 -0500 |
commit | fdf9c8417355fa7348057e279e6863a5ad6614df (patch) | |
tree | 3fcb6556d3341c10aa1b85ea87f21a7fa07ffb2e /src/client/util/History.ts | |
parent | 2809f91453ab75948a7bbe7a0a82a77bf46a627f (diff) | |
parent | 95efa332e0fd7ba9dfddf45c71f02a37052ca24e (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
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) { |