memoize queue item textticker

This commit is contained in:
Violet Caulfield
2025-02-15 10:20:27 -06:00
parent 1f09b4ed59
commit 4667315977

View File

@@ -90,23 +90,28 @@ export default function PlayerScreen({
/>
</YStack>
<YStack
{ useMemo(() => {
<YStack
alignItems="center"
alignContent="center"
flex={3}
>
<Text>Playing from</Text>
<TextTicker {...TextTickerConfig}>
<Text bold>
{
// If the Queue is a BaseItemDto, display the name of it
typeof(queue) === 'object'
? (queue as BaseItemDto).Name ?? "Untitled"
: queue
}
</Text>
</TextTicker>
</YStack>
>
<Text>Playing from</Text>
<TextTicker {...TextTickerConfig}>
<Text bold>
{
// If the Queue is a BaseItemDto, display the name of it
typeof(queue) === 'object'
? (queue as BaseItemDto).Name ?? "Untitled"
: queue
}
</Text>
</TextTicker>
</YStack>
}, [
queue
])}
<Spacer flex={1} />
</XStack>