Skip to content

Commit

Permalink
Merge pull request #383 from pepkit/hot_fix_subsample_list_379
Browse files Browse the repository at this point in the history
Hot fix for subsample list with history changes (#379)
  • Loading branch information
sanghoonio authored Sep 3, 2024
2 parents aa51100 + a62c1ce commit 0689df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-helmet-async": "^1.3.0",
"react-hook-form": "^7.43.8",
"react-hook-form": "^7.52.1",
"react-hot-toast": "^2.4.0",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.9.0",
Expand Down
10 changes: 7 additions & 3 deletions web/src/components/project/project-interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ export const ProjectInterface = (props: Props) => {
}
// SAVE (ctrl + s)
if (ctrlKey && e.key === 's') {
if (projectUpdates.formState.isDirty && !isSubmitting) {
if (true && !isSubmitting) {
// TODO: why does this not work in production?
// if (projectUpdates.formState.isDirty && !isSubmitting) {
e.preventDefault();
handleSubmit();
}
Expand Down Expand Up @@ -189,7 +191,9 @@ export const ProjectInterface = (props: Props) => {
<Fragment>
<div className="pt-0 px-2" style={{ backgroundColor: '#EFF3F640', height: '3.5em' }}>
<ProjectValidationAndEditButtons
isDirty={projectUpdates.formState.isDirty}
isDirty={true}
// TODO: why does this not work in production?
// isDirty={projectUpdates.formState.isDirty}
isUpdatingProject={isSubmitting}
reset={projectUpdates.reset}
handleSubmit={handleSubmit}
Expand Down Expand Up @@ -230,7 +234,7 @@ export const ProjectInterface = (props: Props) => {
onChange={(subsamples) => {
onChange(subsamples);
}}
data={currentHistoryId ? historyData?._subsample_list || [] : newSubsamples}
data={currentHistoryId ? sampleListToArrays(historyData?._subsample_list || []) : newSubsamples}
height={window.innerHeight - 15 - (projectDataRef.current?.offsetTop || 300)}
readOnly={!userCanEdit}
/>
Expand Down

0 comments on commit 0689df3

Please sign in to comment.