Skip to content

Commit

Permalink
fix: bidirectional linking indicator for files
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Oct 12, 2022
1 parent 81532f2 commit 37abac2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useCallback, useState } from 'react'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { ElementIds } from '@/Constants/ElementIDs'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { ContentType } from '@standardnotes/snjs'

type Props = {
linkingController: LinkingController
Expand Down Expand Up @@ -63,8 +64,12 @@ const LinkedItemBubblesContainer = ({ linkingController }: Props) => {
const isItemBidirectionallyLinked = (link: ItemLink) => {
const existsInAllItemLinks = !!allItemLinks.find((item) => link.item.uuid === item.item.uuid)
const existsInNotesLinkingToItem = !!notesLinkingToActiveItem.find((item) => link.item.uuid === item.item.uuid)
const existsInFilesLinkingToItem = !!filesLinkingToActiveItem.find((item) => link.item.uuid === item.item.uuid)

return existsInAllItemLinks && existsInNotesLinkingToItem
return (
existsInAllItemLinks &&
(link.item.content_type === ContentType.Note ? existsInNotesLinkingToItem : existsInFilesLinkingToItem)
)
}

return (
Expand Down

0 comments on commit 37abac2

Please sign in to comment.