fix: fix custom components

This commit is contained in:
Ruben Fiszel
2023-11-10 12:14:02 +01:00
parent e22f3738d5
commit 41364421ea
2 changed files with 21 additions and 6 deletions
@@ -150,6 +150,8 @@
}
let clientName = ''
let licenseKeyChanged = false
</script>
<div class="pb-8">
@@ -387,6 +389,9 @@
<textarea
rows="2"
placeholder={setting.placeholder}
on:keydown={() => {
licenseKeyChanged = true
}}
bind:value={values[setting.key]}
/>
<Button
@@ -407,6 +412,12 @@
>
{/if}
{/if}
{#if licenseKeyChanged}
<div class="text-yellow-600"
>Refresh page after setting license key and saving to unlock all
features</div
>
{/if}
{:else if setting.fieldType == 'email'}
<input
type="email"
@@ -61,17 +61,21 @@
if (customComponent?.additionalLibs?.reactVersion) {
let reactVersion = customComponent.additionalLibs.reactVersion
//@ts-ignore
await import(`https://unpkg.com/react@${reactVersion}/umd/react.development.js`)
await import(
/* @vite-ignore */
`https://unpkg.com/react@${reactVersion}/umd/react.production.min.js`
)
//@ts-ignore
await import(`https://unpkg.com/react-dom@${reactVersion}/umd/react-dom.development.js`)
await import(
/* @vite-ignore */
`https://unpkg.com/react-dom@${reactVersion}/umd/react-dom.production.min.js`
)
}
//@ts-ignore
/* @vite-ignore */
await import(
`http://localhost:3000/api/w/${$workspaceStore ?? 'NO_W'}/resources_u/custom_component/${
customComponent.name
}`
/* @vite-ignore */
`/api/w/${$workspaceStore ?? 'NO_W'}/resources_u/custom_component/${customComponent.name}`
)
loaded = true
try {