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 7, 2024
1 parent ed7052d commit 1c62666
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1569,10 +1569,10 @@
resolved "https://registry.yarnpkg.com/@box/languages/-/languages-1.1.2.tgz#cd4266b3da62da18560d881e10b429653186be29"
integrity sha512-d64TGosx+KRmrLZj4CIyLp42LUiEbgBJ8n8cviMQwTJmfU0g+UwZqLjmQZR1j+Q9D64yV4xHzY9K1t5nInWWeQ==

"@box/metadata-editor@^0.59.4":
version "0.59.6"
resolved "https://registry.yarnpkg.com/@box/metadata-editor/-/metadata-editor-0.59.6.tgz#d000b9dada9787b9446955e5fb9d2727eeb2ac4d"
integrity sha512-265ZemVsJRPg+ZcnzSSm4GOwA65jsCjk/Vro5Hn+ACMuVFsvfs8E77Tmaf4786Vi1eR074MTKATydTApIpZmbA==
"@box/metadata-editor@^0.60.4":
version "0.60.4"
resolved "https://registry.yarnpkg.com/@box/metadata-editor/-/metadata-editor-0.60.4.tgz#71c1a3d9ba34044cfd7584324b472669a3a1ecf2"
integrity sha512-41O1vmjdkHBJYYXcb89E0XS+x/HBUgsu+qt7/N2h0DgpRy9KteMmSVINvqSxl2bNDTbpSBG57+KJlLXT5DpXVA==

"@box/react-virtualized@9.22.3-rc-box.9":
version "9.22.3-rc-box.9"
Expand Down

0 comments on commit 1c62666

Please sign in to comment.