diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx index 0798711d8..af899426a 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx @@ -8,11 +8,7 @@ export interface MaterializedViewComponentProps { } export const MaterializedViewComponent: React.FC = ({ collection }) => { - // If this container itself defines a materialized view, skip rendering this component. - const isTargetContainer = !!collection?.materializedViewDefinition(); - if (isTargetContainer) { - return null; - } + const isSourceContainer = !!collection?.materializedViews(); return ( @@ -26,7 +22,7 @@ export const MaterializedViewComponent: React.FC about how to define materialized views and how to use them. - + {isSourceContainer && } ); }; diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx index 3f52fb252..88c1a02bb 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx @@ -20,11 +20,11 @@ export const MaterializedViewSourceComponent: React.FC { - database.collections().forEach((coll) => { - if (coll.id() === viewId) { - const materializedViewDefinition = coll.materializedViewDefinition(); + database.collections().forEach((collection) => { + if (collection.id() === viewId) { + const materializedViewDefinition = collection.materializedViewDefinition(); materializedViewDefinition && (definition = materializedViewDefinition.definition); - coll.partitionKey?.paths && (partitionKey = coll.partitionKey.paths); + collection.partitionKey?.paths && (partitionKey = collection.partitionKey.paths); } }); });