Skip to content

Commit

Permalink
update site update logic
Browse files Browse the repository at this point in the history
updating the site resets previously selected findspot
  • Loading branch information
fsimonjetz committed May 6, 2024
1 parent 62d45ec commit 64ea07e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/fragmentarium/ui/fragment/ArchaeologyEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,16 @@ class ArchaeologyEditor extends Component<Props, State> {
updateExcavationNumber = (event: ChangeEvent<HTMLInputElement>): void =>
this.updateState('excavationNumber')(event.target.value)

updateSite = (event: ValueType<typeof siteOptions[number], false>): void =>
this.updateState('site')(event?.value || '')
updateSite = (event: ValueType<typeof siteOptions[number], false>): void => {
const updatedState: State = {
...this.state,
site: (event?.value || '') as SiteKey,
findspotId: null,
findspot: null,
}
this.isDirty = !_.isEqual(this.originalState, updatedState)
this.setState(updatedState)
}

updateIsRegularExcavation = (event: ChangeEvent<HTMLInputElement>): void =>
this.updateState('isRegularExcavation')(event.target.checked)
Expand Down

0 comments on commit 64ea07e

Please sign in to comment.