Skip to content

eBPF-based security platform

tools/xtop: keep the detail's hints when its view is opened again

John Fastabend62b1fc20e0d1
diff --git a/tools/xtop/src/App.tsx b/tools/xtop/src/App.tsx
index a62f8845..8c466ae2 100644
--- a/tools/xtop/src/App.tsx
+++ b/tools/xtop/src/App.tsx
@@ -51,7 +51,8 @@ export function App({ backend }: { backend: Backend }) {
setMenuCursor(MENU.findIndex((m) => m.id === view));
setOpenView(view);
setMenuFocused(false);
- setDetail(false);
+ // The view already open stays mounted, and so does its detail.
+ if (view !== openView) setDetail(false);
};
const close = () => {
setOpenView(null);