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 (#2321)

This commit is contained in:
Sebastian Malton 2021-03-12 16:03:34 -05:00 committed by GitHub
parent c815396622
commit 373d2d2a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,14 @@
import { ipcRenderer } from "electron";
import { createBrowserHistory, createMemoryHistory } from "history";
import { createObservableHistory } from "mobx-observable-history";
import logger from "../../main/logger";
export const history = ipcRenderer ? createBrowserHistory() : createMemoryHistory();
export const navigation = createObservableHistory(history);
navigation.listen((location, action) => {
const isClusterView = !process.isMainFrame;
const domain = global.location.href;
logger.debug(`[NAVIGATION]: ${action}`, { isClusterView, domain, location });
});