Skip to content

Commit

Permalink
fix(metadata-sidebar): Add scope to template comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubKida committed Oct 4, 2024
1 parent 7376d0e commit 0722a2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/elements/content-sidebar/MetadataSidebarRedesign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ function MetadataSidebarRedesign({

React.useEffect(() => {
// disable only pre-existing template instances from dropdown if not editing or editing pre-exiting one
if (!editingTemplate || templateInstances.some(t => t.templateKey === editingTemplate.templateKey)) {
if (
!editingTemplate ||
templateInstances.some(
t => t.templateKey === editingTemplate.templateKey && t.scope === editingTemplate.scope,
)
) {
setSelectedTemplates(templateInstances);
} else {
setSelectedTemplates([...templateInstances, editingTemplate]);
Expand Down

0 comments on commit 0722a2e

Please sign in to comment.