add debug prints for actions against the navigation object

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-03-11 13:38:20 -05:00
1 parent 5c6a6e14f5
commit f099489244
1 file changed
+9
+9
View File
@@ -1,6 +1,15 @@
import { ipcRenderer } from "electron";
import { createBrowserHistory, createMemoryHistory } from "history";
import { createObservableHistory } from "mobx-observable-history";
import { getHostedClusterId } from "../../common/cluster-store";
import logger from "../../main/logger";
export const history = ipcRenderer ? createBrowserHistory() : createMemoryHistory();
export const navigation = createObservableHistory(history);
navigation.listen((location, action) => {
const clusterId = getHostedClusterId();
const frame = clusterId ?? "root";
logger.debug(`[NAVIGATION]: ${action}`, { location, frame });
});