Skip to content

Commit

Permalink
refac
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jun 27, 2024
1 parent 8dac2a2 commit 4e6d165
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
26 changes: 16 additions & 10 deletions src/routes/(app)/workspace/functions/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
console.log(func);
});
if (window.opener ?? false) {
window.opener.postMessage('loaded', '*');
}
if (sessionStorage.function) {
func = JSON.parse(sessionStorage.function);
sessionStorage.removeItem('function');
Expand All @@ -61,14 +65,16 @@
</script>
{#if mounted}
<FunctionEditor
id={func?.id ?? ''}
name={func?.name ?? ''}
meta={func?.meta ?? { description: '' }}
content={func?.content ?? ''}
{clone}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{#key func?.content}
<FunctionEditor
id={func?.id ?? ''}
name={func?.name ?? ''}
meta={func?.meta ?? { description: '' }}
content={func?.content ?? ''}
{clone}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{/key}
{/if}
26 changes: 16 additions & 10 deletions src/routes/(app)/workspace/tools/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
console.log(tool);
});
if (window.opener ?? false) {
window.opener.postMessage('loaded', '*');
}
if (sessionStorage.tool) {
tool = JSON.parse(sessionStorage.tool);
sessionStorage.removeItem('tool');
Expand All @@ -58,14 +62,16 @@
</script>
{#if mounted}
<ToolkitEditor
id={tool?.id ?? ''}
name={tool?.name ?? ''}
meta={tool?.meta ?? { description: '' }}
content={tool?.content ?? ''}
{clone}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{#key tool?.content}
<ToolkitEditor
id={tool?.id ?? ''}
name={tool?.name ?? ''}
meta={tool?.meta ?? { description: '' }}
content={tool?.content ?? ''}
{clone}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{/key}
{/if}

0 comments on commit 4e6d165

Please sign in to comment.