diff --git a/src/context/storage-context/storage-provider.tsx b/src/context/storage-context/storage-provider.tsx index 6439bbff..136201e6 100644 --- a/src/context/storage-context/storage-provider.tsx +++ b/src/context/storage-context/storage-provider.tsx @@ -190,7 +190,12 @@ export const StorageProvider: React.FC = ({ options: { includeTables?: boolean; includeRelationships?: boolean; - } = { includeRelationships: false, includeTables: false } + includeDependencies?: boolean; + } = { + includeRelationships: false, + includeTables: false, + includeDependencies: false, + } ): Promise => { let diagrams = await db.diagrams.toArray(); @@ -212,6 +217,15 @@ export const StorageProvider: React.FC = ({ ); } + if (options.includeDependencies) { + diagrams = await Promise.all( + diagrams.map(async (diagram) => { + diagram.dependencies = await listDependencies(diagram.id); + return diagram; + }) + ); + } + return diagrams; };