1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add debug prints for actions against the navigation object

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-03-11 13:38:20 -05:00
parent 5c6a6e14f5
commit f099489244

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 });
});