Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix: set default filter only if has more than 1 schemas (#855)

Guy Ben-Aharonb4ccfcdcde2f
diff --git a/src/context/diagram-filter-context/diagram-filter-provider.tsx b/src/context/diagram-filter-context/diagram-filter-provider.tsx
index 981a8994..b8d8c8a4 100644
--- a/src/context/diagram-filter-context/diagram-filter-provider.tsx
+++ b/src/context/diagram-filter-context/diagram-filter-provider.tsx
@@ -74,7 +74,7 @@ export const DiagramFilterProvider: React.FC<React.PropsWithChildren> = ({
if (!filterToSet) {
// If no filter is stored, set default based on database type
filterToSet =
- schemas.length > 0
+ schemas.length > 1
? { schemaIds: [schemas[0].id] }
: {};
}