aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/History.ts
diff options
context:
space:
mode:
authorMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
committerMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
commit7683e1fbb53fe683c0d04e537d89fb53d768e852 (patch)
treed81eebcd5a129550a49fdfc852b8bb6220907a1a /src/client/util/History.ts
parentf4382d73eec75f7d7f4bfe6eae3fb1efa128a021 (diff)
parentaff9cc02750eb032ade98d77cf9ff45677063fc8 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/client/util/History.ts')
-rw-r--r--src/client/util/History.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/util/History.ts b/src/client/util/History.ts
index 899abbe40..545e8acb4 100644
--- a/src/client/util/History.ts
+++ b/src/client/util/History.ts
@@ -1,6 +1,5 @@
-import { Doc, Opt, Field } from "../../new_fields/Doc";
+import { Doc } from "../../new_fields/Doc";
import { DocServer } from "../DocServer";
-import { RouteStore } from "../../server/RouteStore";
import { MainView } from "../views/MainView";
import * as qs from 'query-string';
import { Utils, OmitKeys } from "../../Utils";
@@ -26,7 +25,7 @@ export namespace HistoryUtil {
// const handlers: ((state: ParsedUrl | null) => void)[] = [];
function onHistory(e: PopStateEvent) {
- if (window.location.pathname !== RouteStore.home) {
+ if (window.location.pathname !== "/home") {
const url = e.state as ParsedUrl || parseUrl(window.location);
if (url) {
switch (url.type) {
@@ -54,7 +53,7 @@ export namespace HistoryUtil {
}
export function getState(): ParsedUrl {
- let state = copyState(history.state);
+ const state = copyState(history.state);
state.initializers = state.initializers || {};
return state;
}
@@ -161,7 +160,7 @@ export namespace HistoryUtil {
const pathname = location.pathname.substring(1);
const search = location.search;
const opts = search.length ? qs.parse(search, { sort: false }) : {};
- let pathnameSplit = pathname.split("/");
+ const pathnameSplit = pathname.split("/");
const type = pathnameSplit[0];