fix script explorer

This commit is contained in:
Ruben Fiszel
2023-04-11 22:12:28 +02:00
parent a026c69af7
commit 3c9cd9218d
4 changed files with 11 additions and 6 deletions
@@ -107,7 +107,7 @@
bind:inlineScript={hiddenInlineScript.script.inlineScript}
/>
{:else}
<span class="text-gray-600 text-xs">No hiddenInlineScript.script defined</span>
<span class="text-gray-600 text-xs">No script defined</span>
{/if}
</div>
{#if Object.keys(hiddenInlineScript.script.fields).length > 0}
@@ -150,7 +150,7 @@
startIcon={{ icon: faCodeBranch }}
btnClasses="truncate"
>
fork a detached script
Copy a script
</Button>
<Button
on:click={() => dispatch('delete')}
@@ -14,8 +14,14 @@
function deleteBackgroundScript(index: number) {
// remove the script from the array at the index
$app.hiddenInlineScripts.splice(index, 1)
$app.hiddenInlineScripts = [...$app.hiddenInlineScripts]
if ($app.hiddenInlineScripts.length - 1 == index) {
$app.hiddenInlineScripts.splice(index, 1)
$app.hiddenInlineScripts = [...$app.hiddenInlineScripts]
} else {
$app.hiddenInlineScripts[index].inlineScript = undefined
$app.hiddenInlineScripts[index].name = `Background Script ${index}`
$app.hiddenInlineScripts = $app.hiddenInlineScripts
}
delete $runnableComponents[`bg_${index}`]
}
@@ -14,7 +14,6 @@
export let recomputeOnInputChanged: boolean = false
const colors = {
red: 'text-red-800 border-red-600 bg-red-100',
green: 'text-green-800 border-green-600 bg-green-100',
indigo: 'text-indigo-800 border-indigo-600 bg-indigo-100',
blue: 'text-blue-800 border-blue-600 bg-blue-100'
@@ -159,7 +158,7 @@
</div>
<div class="flex flex-row gap-2 flex-wrap">
{#each frontendDependencies as label, index}
<span class={classNames(badgeClass, colors['red'])}>
<span class={classNames(badgeClass, colors['blue'])}>
{label}
<button
on:click={() => deleteDep(index)}