refac
This commit is contained in:
@@ -56,15 +56,6 @@
|
|||||||
const allTools = Object.keys(toolLabels);
|
const allTools = Object.keys(toolLabels);
|
||||||
|
|
||||||
export let builtinTools: Record<string, boolean> = {};
|
export let builtinTools: Record<string, boolean> = {};
|
||||||
|
|
||||||
// Initialize missing keys to true (default enabled)
|
|
||||||
$: {
|
|
||||||
for (const tool of allTools) {
|
|
||||||
if (!(tool in builtinTools)) {
|
|
||||||
builtinTools[tool] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -77,10 +68,12 @@
|
|||||||
<Checkbox
|
<Checkbox
|
||||||
state={builtinTools[tool] !== false ? 'checked' : 'unchecked'}
|
state={builtinTools[tool] !== false ? 'checked' : 'unchecked'}
|
||||||
on:change={(e) => {
|
on:change={(e) => {
|
||||||
builtinTools = {
|
if (e.detail === 'checked') {
|
||||||
...builtinTools,
|
delete builtinTools[tool];
|
||||||
[tool]: e.detail === 'checked'
|
} else {
|
||||||
};
|
builtinTools[tool] = false;
|
||||||
|
}
|
||||||
|
builtinTools = builtinTools;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user