15 lines
521 B
JavaScript
15 lines
521 B
JavaScript
// Однократная передача выбранной записи между вкладками без персональных данных в URL.
|
|
let pendingNavigation = null;
|
|
|
|
export function navigateDepartmentTab(tab, context = {}) {
|
|
pendingNavigation = { tab, ...context };
|
|
window.location.hash = tab;
|
|
}
|
|
|
|
export function consumeDepartmentNavigation(tab) {
|
|
if (pendingNavigation?.tab !== tab) return {};
|
|
const context = pendingNavigation;
|
|
pendingNavigation = null;
|
|
return context;
|
|
}
|