feat(platform): separate history capability entry
This commit is contained in:
@@ -299,12 +299,18 @@ export default function App() {
|
||||
const nextFilters = normalizeHistoryFilterValues(filters);
|
||||
const nextVin = nextFilters.keyword?.trim() || analysisVin;
|
||||
const nextProtocol = nextFilters.protocol?.trim() ?? activeProtocol;
|
||||
const nextTab = nextFilters.tab === 'raw' ? 'raw' : 'location';
|
||||
setAnalysisVin(nextVin);
|
||||
setActiveProtocol(nextProtocol);
|
||||
setHistoryTab('location');
|
||||
setHistoryTab(nextTab);
|
||||
setHistoryFilters({ ...nextFilters, keyword: nextVin, protocol: nextProtocol });
|
||||
setActivePage('history');
|
||||
const { keyword, protocol, ...restFilters } = nextFilters;
|
||||
if (nextTab === 'raw') {
|
||||
restFilters.tab = nextTab;
|
||||
} else {
|
||||
delete restFilters.tab;
|
||||
}
|
||||
replaceHash('history', keyword ?? nextVin, protocol ?? nextProtocol, restFilters);
|
||||
};
|
||||
|
||||
@@ -466,7 +472,7 @@ function normalizeMileageFilterValues(filters: Record<string, unknown> = {}): Re
|
||||
|
||||
function normalizeHistoryFilterValues(filters: Record<string, unknown> = {}): Record<string, string> {
|
||||
const normalized: Record<string, string> = {};
|
||||
for (const key of ['keyword', 'protocol', 'dateFrom', 'dateTo', 'fields'] as const) {
|
||||
for (const key of ['keyword', 'protocol', 'dateFrom', 'dateTo', 'fields', 'tab'] as const) {
|
||||
const value = String(filters[key] ?? '').trim();
|
||||
if (value) {
|
||||
normalized[key] = value;
|
||||
|
||||
Reference in New Issue
Block a user