Skip to content

Commit

Permalink
lets try this way
Browse files Browse the repository at this point in the history
  • Loading branch information
nleroy917 committed Jul 18, 2024
1 parent d4e164c commit fa71cd0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/src/components/project/project-interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,12 @@ export const ProjectInterface = (props: Props) => {
<Controller
control={projectUpdates.control}
name="samples"
render={({ field: { onChange } }) => (
render={() => (
<SampleTable
onChange={(samples) => {
onChange(samples);
projectUpdates.setValue('samples', samples, {
shouldDirty: true,
});
}}
readOnly={!userCanEdit}
data={currentHistoryId ? sampleListToArrays(historyData?._sample_dict || []) : newSamples}
Expand All @@ -182,10 +184,12 @@ export const ProjectInterface = (props: Props) => {
<Controller
control={projectUpdates.control}
name="subsamples"
render={({ field: { onChange } }) => (
render={() => (
<SampleTable
onChange={(subsamples) => {
onChange(subsamples);
projectUpdates.setValue('subsamples', subsamples, {
shouldDirty: true,
});
}}
data={currentHistoryId ? historyData?._subsample_list || [] : newSubsamples}
height={window.innerHeight - 15 - (projectDataRef.current?.offsetTop || 300)}
Expand Down

0 comments on commit fa71cd0

Please sign in to comment.