mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 16:21:39 +00:00
fix: preload schema options when selector becomes visible (closes #244)
Schema dropdown showed an empty horizontal line because data was loaded lazily on dropdown open, leaving the Reka UI Select with zero items in popper mode. Eagerly preload via watchEffect when the schema selector becomes visible so data is ready before the user opens the dropdown.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { computed, watchEffect } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import {
|
||||
Play,
|
||||
@@ -75,6 +75,13 @@ const activeSchemaOptions = computed(() => {
|
||||
return getSchemaOptionsForDb(connection.id, schemaDatabaseKey.value);
|
||||
});
|
||||
|
||||
watchEffect(() => {
|
||||
const connection = props.activeConnection;
|
||||
if (connection && showSchemaSelector.value && schemaDatabaseKey.value) {
|
||||
loadSchemaOptions(connection.id, schemaDatabaseKey.value).catch(() => {});
|
||||
}
|
||||
});
|
||||
|
||||
const isActiveDatabaseDefault = computed(() => isDefaultDatabase(props.activeConnection, activeDatabaseValue.value));
|
||||
const toolbarStyle = computed(() => {
|
||||
const color = props.activeConnection?.color;
|
||||
|
||||
Reference in New Issue
Block a user