Skip to content

Commit

Permalink
refactor(TripSeriesModal): remove clearState method
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianaCeric committed Nov 22, 2023
1 parent 6a8a993 commit 512d242
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/editor/components/timetable/TripSeriesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -112,7 +108,7 @@ const TripSeriesModal = (props: Props) => {
if (currentBlockIdSuffix > autoBlockIdIncrement) currentBlockIdSuffix = currentBlockIdSuffix % autoBlockIdIncrement
}
}
clearState()
setState(initialState)
onClose()
}, [state])

Expand Down

0 comments on commit 512d242

Please sign in to comment.