chore: update memo relation definition

This commit is contained in:
Steven
2024-03-19 21:53:44 +08:00
parent 722e356044
commit ed89cb8310
13 changed files with 369 additions and 357 deletions

View File

@ -75,7 +75,10 @@ const MemoEditor = (props: Props) => {
const [contentCache, setContentCache] = useLocalStorage<string>(contentCacheKey, "");
const referenceRelations = memoId
? state.relationList.filter(
(relation) => relation.memoId === memoId && relation.relatedMemoId !== memoId && relation.type === MemoRelation_Type.REFERENCE,
(relation) =>
extractMemoIdFromName(relation.memo) === memoId &&
extractMemoIdFromName(relation.relatedMemo) !== memoId &&
relation.type === MemoRelation_Type.REFERENCE,
)
: state.relationList.filter((relation) => relation.type === MemoRelation_Type.REFERENCE);