fix: DB list for different connection

This commit is contained in:
Jan Prochazka
2024-06-03 10:14:17 +02:00
parent 5c703c786d
commit d454da325f
3 changed files with 21 additions and 2 deletions

View File

@@ -4,6 +4,9 @@
import { getFormContext } from '../forms/FormProviderCore.svelte';
import FormSelectField from '../forms/FormSelectField.svelte';
import { useDatabaseList } from '../utility/metadataLoaders';
import uuidv1 from 'uuid/v1';
import { temporaryOpenedConnections } from '../stores';
import useEffect from '../utility/useEffect';
export let conidName;
@@ -17,6 +20,16 @@
})),
'label'
);
const tmpid = uuidv1();
$: effect = useEffect(() => {
temporaryOpenedConnections.update(x => [...x, { tmpid, conid: $values && $values[conidName] }]);
return () => {
temporaryOpenedConnections.update(x => x.filter(y => y.tmpid != tmpid));
};
});
$: $effect;
</script>
<FormSelectField {...$$restProps} options={databaseOptions} />