From 512d24256b696f19f3dfddee6071dd834953fa23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adriana=20Ceri=C4=87?= <62163307+AdrianaCeric@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:32:42 -0500 Subject: [PATCH] refactor(TripSeriesModal): remove clearState method --- lib/editor/components/timetable/TripSeriesModal.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/editor/components/timetable/TripSeriesModal.js b/lib/editor/components/timetable/TripSeriesModal.js index b39fb2e45..da35f02c9 100644 --- a/lib/editor/components/timetable/TripSeriesModal.js +++ b/lib/editor/components/timetable/TripSeriesModal.js @@ -68,13 +68,9 @@ const TripSeriesModal = (props: Props) => { const handleAutoTripIDCheckBox = () => setState((prevState) => ({ ...prevState, useAutoTripIds: !prevState.useAutoTripIds })) const handleAutoBlockIDCheckBox = () => setState((prevState) => ({ ...prevState, useAutoBlockIds: !prevState.useAutoBlockIds })) - const clearState = () => { - setState(initialState) - } - const _onClose = () => { const { onClose } = props - clearState() + setState(initialState) onClose() } @@ -112,7 +108,7 @@ const TripSeriesModal = (props: Props) => { if (currentBlockIdSuffix > autoBlockIdIncrement) currentBlockIdSuffix = currentBlockIdSuffix % autoBlockIdIncrement } } - clearState() + setState(initialState) onClose() }, [state])