feat(platform): remove default history vehicle
This commit is contained in:
@@ -16,7 +16,7 @@ import { Vehicles } from './pages/Vehicles';
|
||||
|
||||
export default function App() {
|
||||
const initialRoute = parseAppHash(window.location.hash);
|
||||
const initialVehicleKey = initialRoute.keyword || 'LB9A32A24R0LS1426';
|
||||
const initialVehicleKey = initialRoute.keyword || '';
|
||||
const [activePage, setActivePage] = useState<PageKey>(initialRoute.page ?? 'dashboard');
|
||||
const [activeVin, setActiveVin] = useState(initialVehicleKey);
|
||||
const [analysisVin, setAnalysisVin] = useState(initialVehicleKey);
|
||||
@@ -351,7 +351,8 @@ export default function App() {
|
||||
|
||||
const openHistoryWithFilters = (filters: Record<string, string> = {}) => {
|
||||
const nextFilters = normalizeHistoryFilterValues(filters);
|
||||
const nextVin = nextFilters.keyword?.trim() || analysisVin;
|
||||
const hasKeywordInput = Object.prototype.hasOwnProperty.call(nextFilters, 'keyword');
|
||||
const nextVin = nextFilters.keyword?.trim() || (hasKeywordInput ? '' : analysisVin);
|
||||
const nextProtocol = nextFilters.protocol?.trim() ?? activeProtocol;
|
||||
const nextTab = nextFilters.tab === 'raw' || nextFilters.tab === 'fields' ? nextFilters.tab : 'location';
|
||||
const nextPage = nextTab === 'raw' || nextTab === 'fields' ? 'history-query' : 'history';
|
||||
@@ -385,11 +386,9 @@ export default function App() {
|
||||
|
||||
const openRawWithFilters = (filters: Record<string, string> = {}) => {
|
||||
const nextFilters = normalizeHistoryFilterValues(filters);
|
||||
const nextVin = nextFilters.keyword?.trim() || analysisVin;
|
||||
const hasKeywordInput = Object.prototype.hasOwnProperty.call(nextFilters, 'keyword');
|
||||
const nextVin = nextFilters.keyword?.trim() || (hasKeywordInput ? '' : analysisVin);
|
||||
const nextProtocol = nextFilters.protocol?.trim() ?? activeProtocol;
|
||||
if (!nextVin) {
|
||||
return;
|
||||
}
|
||||
setAnalysisVin(nextVin);
|
||||
setActiveProtocol(nextProtocol);
|
||||
setHistoryTab('raw');
|
||||
|
||||
Reference in New Issue
Block a user