diff --git a/src/app/scout.tsx b/src/app/scout.tsx index 4ce83e9..1e22128 100644 --- a/src/app/scout.tsx +++ b/src/app/scout.tsx @@ -1,6 +1,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import { useLocalSearchParams } from 'expo-router'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { Pressable, ScrollView, @@ -287,6 +287,7 @@ export default function ScoutScreen() { const [hasLoadedRecentPicks, setHasLoadedRecentPicks] = useState(false); const [appliedRouteGameId, setAppliedRouteGameId] = useState(null); const [appliedRouteVenueId, setAppliedRouteVenueId] = useState(null); + const gameSearchInputRef = useRef(null); const filteredVenues = useMemo(() => { const normalizedQuery = venueQuery.trim().toLowerCase(); @@ -728,11 +729,20 @@ export default function ScoutScreen() { function resetReportDetails() { setSelectedGame(null); setGameQuery(''); + setSelectedReportType('confirmed_present'); setQuantity('1'); setMachineLabel(''); setNotes(''); } + function prepareNextCabinetReport() { + resetReportDetails(); + + setTimeout(() => { + gameSearchInputRef.current?.focus(); + }, 50); + } + function addQuickNote(note: string) { setNotes((currentNotes) => { const trimmedNotes = currentNotes.trim(); @@ -951,9 +961,9 @@ export default function ScoutScreen() { ...currentSubmissions, ].slice(0, 20)); setSubmitMessage( - `Submitted ${submittedGameTitle}. ${submittedVenueName} is still selected for the next cabinet.`, + `Added ${submittedGameTitle}. Pick the next game at ${submittedVenueName}.`, ); - resetReportDetails(); + prepareNextCabinetReport(); await refreshMyPendingItems(); if (sessionRole === 'admin') { @@ -1542,6 +1552,7 @@ export default function ScoutScreen() { 2. Pick a game { setGameQuery(value); setSelectedGame(null);