diff --git a/src/components/events/resetState.tsx b/src/components/events/resetState.tsx index 8c392cdf..0e074894 100644 --- a/src/components/events/resetState.tsx +++ b/src/components/events/resetState.tsx @@ -17,6 +17,7 @@ import { resetDriverStints, resetMessages, resetPits, + resetRaceGlobalSettings, resetRaceGraph, resetRaceGraphRelative, resetRacePositions, @@ -31,7 +32,7 @@ import { // import { initialReplaySettings } from "../../stores/ui/reducer"; export const resetUI = (dispatch: Dispatch) => { - // dispatch(resetGlobalSettings()); + dispatch(resetRaceGlobalSettings()); dispatch(resetStandingsColumns()); dispatch(resetClassification()); dispatch(resetCircleOfDoom()); diff --git a/src/stores/grpc/slices/userSettingsSlice.ts b/src/stores/grpc/slices/userSettingsSlice.ts index ec356219..c6bab7a8 100644 --- a/src/stores/grpc/slices/userSettingsSlice.ts +++ b/src/stores/grpc/slices/userSettingsSlice.ts @@ -93,6 +93,12 @@ const globalSettings = createSlice({ resetGlobalSettings() { return initialStateGlobalSettings; }, + resetRaceGlobalSettings(state) { + state.filterCarClasses = []; + state.referenceCarNum = undefined; + state.showCars = []; + state.highlightCars = []; + }, }, }); const initialStateStandings = { availableColumns: [] as IColumnInfo[] }; @@ -450,6 +456,7 @@ export const combined = combineSlices( export const { updateGlobalSettings, resetGlobalSettings, + resetRaceGlobalSettings, toggleFilterOrderByPosition, toggleSyncSelection, toggleCompact,