chore: update memo relations view

This commit is contained in:
Steven
2023-10-02 08:26:15 +08:00
parent 70f464e6f2
commit 078bc164d5
4 changed files with 44 additions and 12 deletions

View File

@ -12,9 +12,7 @@ const MemoRelationListView = (props: Props) => {
useEffect(() => {
(async () => {
// Only show reference relations.
const relationList = props.relationList.filter((relation) => relation.type === "REFERENCE");
const memoList = await Promise.all(relationList.map((relation) => memoCacheStore.getOrFetchMemoById(relation.relatedMemoId)));
const memoList = await Promise.all(props.relationList.map((relation) => memoCacheStore.getOrFetchMemoById(relation.relatedMemoId)));
setRelatedMemoList(memoList);
})();
}, [props.relationList]);