mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
fix: prevent Collapsible onChange from firing on initial mount
This commit is contained in:
parent
4923920bf1
commit
7186bec195
1 changed files with 4 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { decode } from 'html-entities';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { getContext } from 'svelte';
|
||||
import { getContext, onMount } from 'svelte';
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
import dayjs from '$lib/dayjs';
|
||||
|
|
@ -55,7 +55,9 @@
|
|||
|
||||
export let onChange: Function = () => {};
|
||||
|
||||
$: onChange(open);
|
||||
let _mounted = false;
|
||||
onMount(() => { _mounted = true; });
|
||||
$: if (_mounted) onChange(open);
|
||||
|
||||
const collapsibleId = uuidv4();
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue