fix: Collection with only draft shows empty state, closes #3119

This commit is contained in:
Tom Moor
2022-02-17 20:17:02 -08:00
parent cbe65ddcd7
commit 27f9172750
2 changed files with 10 additions and 2 deletions

View File

@@ -142,7 +142,12 @@ export default class DocumentsStore extends BaseStore<Document> {
return [];
}
return compact(collection.documents.map((node) => this.get(node.id)));
const drafts = this.drafts({ collectionId });
return compact([
...drafts,
...collection.documents.map((node) => this.get(node.id)),
]);
}
leastRecentlyUpdatedInCollection(collectionId: string): Document[] {