mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
15 lines
596 B
TypeScript
15 lines
596 B
TypeScript
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}-ing. Current is now:`, { isClusterView, domain, location });
|
|
});
|