Fix general attributes replacements (#3438)

Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
Ruslan Bayandinov
2023-06-16 15:51:09 +07:00
committed by GitHub
parent ed504d9c98
commit 354e76e1f1
2 changed files with 16 additions and 4 deletions
@@ -161,8 +161,6 @@
$: if (keepOriginalAttribytes) {
setOriginalAttributes()
} else if (currentSpace !== undefined) {
statusToUpdate = {}
componentToUpdate = {}
setReplacementAttributres(currentSpace)
}
@@ -361,7 +359,18 @@
props: { label: tracker.string.KeepOriginalAttributesTooltip }
}}
>
<div class="mr-2"><Toggle disabled={!isManageAttributesAvailable} bind:on={keepOriginalAttribytes} /></div>
<div class="mr-2">
<Toggle
disabled={!isManageAttributesAvailable}
on:change={() => {
keepOriginalAttribytes = !keepOriginalAttribytes
if (!keepOriginalAttribytes) {
statusToUpdate = {}
componentToUpdate = {}
}
}}
/>
</div>
<Label label={tracker.string.KeepOriginalAttributes} />
</div>
<div class="buttons">
@@ -156,7 +156,10 @@
if (value !== undefined) {
const createComponent = typeof value === 'object'
const c = createComponent ? value.create : value
statusToUpdate = { ...statusToUpdate, [component._id]: { ref: c, create: createComponent } }
componentToUpdate = {
...componentToUpdate,
[component._id]: { ref: c, create: createComponent }
}
}
}
)