fix refreshOn

This commit is contained in:
Ruben Fiszel
2023-04-13 09:22:52 +02:00
parent a5499c26f3
commit 8928cfa3d7
7 changed files with 5 additions and 28 deletions
+1 -1
View File
@@ -1810,9 +1810,9 @@ async fn handle_deno_job(
//do not cache local dependencies
let reload = format!("--reload={base_internal_url}");
let child = async {
let mut args = Vec::new();
let script_path = format!("{job_dir}/wrapper.ts");
let import_map_path = format!("{job_dir}/import_map.json");
let mut args = Vec::new();
args.push("run");
args.push("--no-check");
args.push("--import-map");
@@ -11,7 +11,7 @@
import { sendUserToast } from '$lib/utils'
import { gridColumns } from '../../gridUtils'
const { app, selectedComponent, worldStore, focusedGrid, componentControl } =
const { app, selectedComponent, focusedGrid, componentControl } =
getContext<AppViewerContext>('AppViewerContext')
const { history, movingcomponents } = getContext<AppEditorContext>('AppEditorContext')
@@ -209,7 +209,6 @@
$selectedComponent = nitems.map((x) => x)
}
$worldStore = $worldStore
$app = $app
}
@@ -15,8 +15,7 @@
import { push } from '$lib/history'
import { flip } from 'svelte/animate'
const { app, selectedComponent, focusedGrid, worldStore } =
getContext<AppViewerContext>('AppViewerContext')
const { app, selectedComponent, focusedGrid } = getContext<AppViewerContext>('AppViewerContext')
const { history } = getContext<AppEditorContext>('AppEditorContext')
@@ -33,7 +32,6 @@
$selectedComponent = [id]
$app = $app
$worldStore = $worldStore
}
let search = ''
@@ -135,9 +135,7 @@
runnable?.type === 'runnableByName' &&
runnable?.inlineScript?.refreshOn?.find((x) => x.id === from)
) {
console.log('processss')
runnable.inlineScript.refreshOn = runnable.inlineScript.refreshOn.map((x) => {
console.log('renaming', x)
if (x.id === from) {
return {
id: to,
@@ -87,22 +87,6 @@
inlineScript?.language == 'frontend' && worldStore
? buildExtraLib($worldStore?.outputsById ?? {}, id, false, $state, true)
: undefined
let refreshOn: string = inlineScript?.refreshOn?.map((x) => `${x.id}.${x.key}`).join(' ') ?? ''
$: handleRefreshOn(refreshOn)
function handleRefreshOn(refreshOn: string) {
if (refreshOn && refreshOn != '' && inlineScript) {
inlineScript.refreshOn = refreshOn
.split(' ')
.filter((x) => x.split('.').length == 2)
.map((x) => {
const [id, key] = x.split('.')
return { id, key }
})
}
}
</script>
{#if inlineScript}
@@ -7,7 +7,7 @@
export let componentInput: ConnectedAppInput
const { connectingInput, app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
const { connectingInput, app } = getContext<AppViewerContext>('AppViewerContext')
function applyConnection() {
if (
@@ -22,7 +22,6 @@
hoveredComponent: undefined
}
$app = $app
$worldStore = $worldStore
}
}
@@ -21,7 +21,7 @@
let badgeClass = 'inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium border'
const { app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
const { app } = getContext<AppViewerContext>('AppViewerContext')
const { connectingInput } = getContext<AppViewerContext>('AppViewerContext')
@@ -60,7 +60,6 @@
hoveredComponent: undefined
}
$app = $app
$worldStore = $worldStore
}
}