fix inline script update effect

This commit is contained in:
Ruben Fiszel
2025-04-11 23:05:10 +00:00
parent 58bcf40498
commit 6d58d87e79
@@ -63,11 +63,16 @@
return schema
}
$: inlineScript &&
(inlineScript.path = `${defaultIfEmptyString(
$appPath,
`u/${$userStore?.username ?? 'unknown'}/newapp`
)}/${name?.replaceAll(' ', '_')}`)
$: name && onNameChange()
function onNameChange() {
if (inlineScript) {
inlineScript.path = `${defaultIfEmptyString(
$appPath,
`u/${$userStore?.username ?? 'unknown'}/newapp`
)}/${name?.replaceAll(' ', '_')}`
}
}
onMount(async () => {
if (inlineScript && !inlineScript.schema) {
@@ -85,6 +90,9 @@
if (inlineScript?.language == 'frontend' && inlineScript.content) {
inferSuggestions(inlineScript.content)
}
if (!inlineScript?.path) {
onNameChange()
}
})
const dispatch = createEventDispatcher()