From f099489244bad172b76ecf5969130e67132f0cb9 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 11 Mar 2021 13:38:20 -0500 Subject: [PATCH] add debug prints for actions against the navigation object Signed-off-by: Sebastian Malton --- src/renderer/navigation/history.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/renderer/navigation/history.ts b/src/renderer/navigation/history.ts index 522cb86b21..cfa11cb2f6 100644 --- a/src/renderer/navigation/history.ts +++ b/src/renderer/navigation/history.ts @@ -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 }); +});