feat(platform): prevent unscoped raw field lookups
This commit is contained in:
@@ -189,10 +189,13 @@ export default function App() {
|
||||
};
|
||||
|
||||
const updateHistoryFilters = (filters: Record<string, unknown> = {}, tab = historyTab) => {
|
||||
const hasKeywordInput = Object.prototype.hasOwnProperty.call(filters, 'keyword');
|
||||
const nextFilters = normalizeHistoryFilterValues(filters);
|
||||
setHistoryFilters(nextFilters);
|
||||
if (nextFilters.keyword) {
|
||||
setAnalysisVin(nextFilters.keyword);
|
||||
} else if (hasKeywordInput) {
|
||||
setAnalysisVin('');
|
||||
}
|
||||
setActiveProtocol(nextFilters.protocol ?? '');
|
||||
setHistoryTab(tab);
|
||||
@@ -201,7 +204,7 @@ export default function App() {
|
||||
if (tab && tab !== 'location') {
|
||||
routeFilters.tab = tab;
|
||||
}
|
||||
replaceHash('history', keyword ?? analysisVin, protocol, routeFilters);
|
||||
replaceHash('history', hasKeywordInput ? keyword : (keyword ?? analysisVin), protocol, routeFilters);
|
||||
};
|
||||
|
||||
const replaceHistoryHash = (filters: Record<string, string> = {}, tab = historyTab) => {
|
||||
|
||||
Reference in New Issue
Block a user