Skip to content

Commit

Permalink
Stop schema bleed (#270).
Browse files Browse the repository at this point in the history
  • Loading branch information
jimafisk committed Feb 17, 2023
1 parent 99d9b32 commit d1b3d4a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions defaults/core/cms/fields/component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
}
return matching;
}
let compSchema;
const setCompSchema = component => {
let compDefaults = structuredClone(allComponentDefaults);
let compSchemas = structuredClone(allComponentSchemas);
Expand All @@ -37,7 +36,7 @@
delete b.plenti_salt;
for (const c in compDefaults) {
if (objKeysMatch(compDefaults[c], b)) {
compSchema = compSchemas[c];
return compSchemas[c];
}
}
}
Expand All @@ -46,8 +45,7 @@
import {slide} from "svelte/transition";
let isOpen = false;
let openKeys = [];
const accordion = (newKey, component) => {
setCompSchema(component);
const accordion = (newKey) => {
if (openKeys.length === 1 && openKeys.includes(newKey)) {
setTimeout(() => {
isOpen = false;
Expand Down Expand Up @@ -233,7 +231,7 @@

<div
class="content"
on:click|preventDefault={accordion(key, value)}
on:click|preventDefault={accordion(key)}
on:click={toggleSalt(value)}
>
{#if value.constructor === "".constructor}
Expand Down Expand Up @@ -264,7 +262,7 @@
bind:changingMedia
bind:localMediaList
parentKeys={""}
schema={compSchema}
schema={setCompSchema(value)}
/>
</div>
{/if}
Expand Down

0 comments on commit d1b3d4a

Please sign in to comment.