Fix types

This commit is contained in:
2024-01-07 01:29:58 +01:00
committed by Clément Le Bihan
parent 17a4328af5
commit 3c04e8bb39
20 changed files with 35 additions and 197 deletions

View File

@@ -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) {