From 373d2d2a47ebf54aa3abb91bbb9be7e35cfc1db6 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 12 Mar 2021 16:03:34 -0500 Subject: [PATCH] add debug prints for actions against the navigation object (#2321) --- src/renderer/navigation/history.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/renderer/navigation/history.ts b/src/renderer/navigation/history.ts index 522cb86b21..f12b89f365 100644 --- a/src/renderer/navigation/history.ts +++ b/src/renderer/navigation/history.ts @@ -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 }); +});