mirror of
https://github.com/open-webui/open-webui
synced 2025-06-08 15:37:22 +00:00
fix
This commit is contained in:
parent
5f29a9edf4
commit
fc46532955
@ -131,7 +131,9 @@
|
|||||||
<button
|
<button
|
||||||
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
||||||
type="button"
|
type="button"
|
||||||
on:click={async () => {
|
on:click={async (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
|
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
return null;
|
return null;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
|
|
||||||
|
let mounted = false;
|
||||||
let clone = false;
|
let clone = false;
|
||||||
let tool = null;
|
let tool = null;
|
||||||
|
|
||||||
@ -30,23 +31,27 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
console.log('mounted');
|
|
||||||
|
|
||||||
if (sessionStorage.tool) {
|
if (sessionStorage.tool) {
|
||||||
tool = JSON.parse(sessionStorage.tool);
|
tool = JSON.parse(sessionStorage.tool);
|
||||||
sessionStorage.removeItem('tool');
|
sessionStorage.removeItem('tool');
|
||||||
|
|
||||||
|
console.log(tool);
|
||||||
clone = true;
|
clone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mounted = true;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ToolkitEditor
|
{#if mounted}
|
||||||
id={tool?.id ?? ''}
|
<ToolkitEditor
|
||||||
name={tool?.name ?? ''}
|
id={tool?.id ?? ''}
|
||||||
meta={tool?.meta ?? { description: '' }}
|
name={tool?.name ?? ''}
|
||||||
content={tool?.content ?? ''}
|
meta={tool?.meta ?? { description: '' }}
|
||||||
{clone}
|
content={tool?.content ?? ''}
|
||||||
on:save={(e) => {
|
{clone}
|
||||||
saveHandler(e.detail);
|
on:save={(e) => {
|
||||||
}}
|
saveHandler(e.detail);
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user