2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

rename var to remove confusion

This commit is contained in:
Matthias Mair
2025-01-20 21:45:50 +01:00
parent 510361f30c
commit 6bad3ff2ff

View File

@ -116,20 +116,20 @@ function BasePanelGroup({
// Callback when the active panel changes // Callback when the active panel changes
const handlePanelChange = useCallback( const handlePanelChange = useCallback(
(panel: string, event?: any) => { (targetPanel: string, event?: any) => {
if (event && (event?.ctrlKey || event?.shiftKey)) { if (event && (event?.ctrlKey || event?.shiftKey)) {
const url = `${location.pathname}/../${panel}`; const url = `${location.pathname}/../${targetPanel}`;
cancelEvent(event); cancelEvent(event);
navigateToLink(url, navigate, event); navigateToLink(url, navigate, event);
} else { } else {
navigate(`../${panel}`); navigate(`../${targetPanel}`);
} }
localState.setLastUsedPanel(pageKey)(panel); localState.setLastUsedPanel(pageKey)(targetPanel);
// Optionally call external callback hook // Optionally call external callback hook
if (panel && onPanelChange) { if (targetPanel && onPanelChange) {
onPanelChange(panel); onPanelChange(targetPanel);
} }
}, },
[activePanels, navigate, location, onPanelChange] [activePanels, navigate, location, onPanelChange]