fix: handle URL tab parameter in admin pricing page
- Parse URLSearchParams to detect ?tab=pricelists on page load - Load tab from URL or default to 'alerts' - Fixes redirect from /pricelists to /admin/pricing?tab=pricelists This resolves the critical UX issue where users redirected from /pricelists would see the 'alerts' tab instead of 'pricelists'. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -877,7 +877,10 @@ function renderAllConfigs(configs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
loadTab('alerts');
|
// Check URL params for initial tab
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const initialTab = urlParams.get('tab') || 'alerts';
|
||||||
|
loadTab(initialTab);
|
||||||
|
|
||||||
// Add event listeners for preview updates
|
// Add event listeners for preview updates
|
||||||
document.getElementById('modal-period').addEventListener('change', fetchPreview);
|
document.getElementById('modal-period').addEventListener('change', fetchPreview);
|
||||||
|
|||||||
Reference in New Issue
Block a user