Skip to content

Commit

Permalink
quickfix fileupload with tag and simple binding (#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjosttveit authored Oct 22, 2024
1 parent 4fdf390 commit 0ee1c47
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/features/options/StoreOptionsInNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,20 @@ function StoreOptionsInNodeWorker({ valueType }: GeneratorOptionProps) {
return false;
}

// Quickfix to fix simpleBinding being cleared as stale in FileUploadWithTag,
// we don't store option values here so it makes no sense to do this,
// consider solving this more elegantly in the future.
// AFAIK, stale values are not removed from attachment tags, maybe they should?
const shouldRemoveStaleValues = !node.isType('FileUploadWithTag');

return (
<>
<EffectRemoveStaleValues
valueType={valueType}
options={options}
/>
{shouldRemoveStaleValues && (
<EffectRemoveStaleValues
valueType={valueType}
options={options}
/>
)}
{preselectedOption !== undefined && (
<EffectPreselectedOptionIndex
preselectedOption={preselectedOption}
Expand Down

0 comments on commit 0ee1c47

Please sign in to comment.