Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Fix getState undefined when opening reopening app on android (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Oct 11, 2022
1 parent ef69b70 commit 78dee89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/mobile/src/components/lineup-tile/TrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
shareModalUIActions,
RepostType
} from '@audius/common'
import { useNavigationState } from '@react-navigation/native'
import { useDispatch, useSelector } from 'react-redux'

import type { LineupItemProps } from 'app/components/lineup-tile/types'
Expand Down Expand Up @@ -66,6 +67,7 @@ const TrackTileComponent = ({
}: TrackTileProps) => {
const dispatch = useDispatch()
const navigation = useNavigation()
const currentScreen = useNavigationState((state) => state.history?.[0])
const playingUid = useSelector(getUid)
const isPlayingUid = playingUid === lineupTileProps.uid

Expand All @@ -81,7 +83,6 @@ const TrackTileComponent = ({
track_id
} = track

const currentScreen = navigation.getState().history?.[0]
// @ts-expect-error -- history returning unknown[]
const isOnArtistsTracksTab = currentScreen?.key.includes('Tracks')

Expand Down

0 comments on commit 78dee89

Please sign in to comment.