Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render no image if media is present #2416

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/App/SideBar/SelectedNodeView/Default/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useAppStore } from '~/stores/useAppStore'
import { useSelectedNode } from '~/stores/useGraphStore'
import { colors } from '~/utils/colors'
import { BoostAmt } from '../../../Helper/BoostAmt'
import { usePlayerStore } from '~/stores/usePlayerStore'

export const Default = () => {
const selectedNode = useSelectedNode()
Expand All @@ -26,6 +27,8 @@ export const Default = () => {
const [isPlaying, setIsPlaying] = useState(false)
const [boostAmount, setBoostAmount] = useState<number>(selectedNode?.properties?.boost || 0)

const { playingNode } = usePlayerStore((s) => s)

useEffect(() => {
setBoostAmount(selectedNode?.properties?.boost || 0)
}, [selectedNode])
Expand Down Expand Up @@ -76,7 +79,7 @@ export const Default = () => {
return null
}

const hasImage = !!selectedNode.properties?.image_url
const hasImage = !playingNode?.ref_id && !!selectedNode.properties?.image_url
const hasAudio = !!selectedNode.properties?.audio_EN
const customKeys = selectedNode.properties || {}
const sourceLink = selectedNode.properties?.source_link
Expand Down Expand Up @@ -155,7 +158,7 @@ const NodeDetail = ({ label, value, hasAudio, isPlaying, togglePlay }: Props) =>
const isLong = (value as string).length > 140
const searchTerm = useAppStore((s) => s.currentSearch)

if (!value || label === 'Audio EN' || label === 'Source Link') {
if (!value || label === 'Audio EN' || label === 'Source Link' || label === 'Image Url') {
return null
}

Expand Down
Loading