Skip to content

Commit

Permalink
fix: empty tables errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Sep 11, 2024
1 parent 6c37d8b commit ac0aba5
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ const treeItems = computed<DatabaseNavItem[]>(() => {
const { metadata } = state;
if (!metadata?.databases) return [] as DatabaseNavItem[];
return metadata.databases.map(d => {
if (!d.tables) return [];
return {
id: `${d.name}`,
name: d.name,
label: d.name,
icon: ['fa', 'database'],
type: 'database',
data: d,
children: d.tables.map(t => {
children: d.tables?.map(t => {
return {
id: `${d.name}:${t.name}`,
name: t.name,
Expand Down Expand Up @@ -93,7 +92,6 @@ const getMetadata = async () => {
updateDefaultExpandedKeys();
};
const updateDefaultExpandedKeys = () => {
console.debug('updateDefaultExpandedKeys');
if (treeItems.value.length === 1) {
const currentItem = treeItems.value[0];
defaultExpandedKeys.value = [currentItem.id];
Expand Down

0 comments on commit ac0aba5

Please sign in to comment.