Fix types
This commit is contained in:
@@ -12,7 +12,7 @@ import Animated, {
|
||||
} from 'react-native-reanimated';
|
||||
import * as ScreenOrientation from 'expo-screen-orientation';
|
||||
import { Text, Row, View, useToast } from 'native-base';
|
||||
import { RouteProps, useNavigation } from '../Navigation';
|
||||
import { useNavigation } from '../Navigation';
|
||||
import { useQuery } from '../Queries';
|
||||
import API from '../API';
|
||||
import { LoadingView } from '../components/Loading';
|
||||
@@ -68,7 +68,7 @@ function parseMidiMessage(message: MIDIMessageEvent) {
|
||||
};
|
||||
}
|
||||
|
||||
const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
||||
const PlayView = ({ songId }: PlayViewProps) => {
|
||||
const [playType, setPlayType] = useState<'practice' | 'normal' | null>(null);
|
||||
const accessToken = useSelector((state: RootState) => state.user.accessToken);
|
||||
const navigation = useNavigation();
|
||||
@@ -283,7 +283,7 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
||||
useEffect(() => {
|
||||
// Song.data is updated on navigation.navigate (do not know why)
|
||||
// Hotfix to prevent midi setup process from reruning on game end
|
||||
if (navigation.getState().routes.at(-1)?.name != route.name) {
|
||||
if (navigation.getState().routes.at(-1)?.name != "Play") {
|
||||
return;
|
||||
}
|
||||
if (playType && song.data && !webSocket.current) {
|
||||
|
||||
Reference in New Issue
Block a user