fix: correct typescript ref types for bottom sheet and audio player

This commit is contained in:
Mohamed Boudra
2025-10-23 20:06:11 +02:00
parent e7306ab495
commit a0f45f2cfc
4 changed files with 4 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ export function AgentStreamView({
onPermissionResponse,
}: AgentStreamViewProps) {
const scrollViewRef = useRef<ScrollView>(null);
const bottomSheetRef = useRef<BottomSheetModal>(null);
const bottomSheetRef = useRef<BottomSheetModal | null>(null);
const insets = useSafeAreaInsets();
const [selectedToolCall, setSelectedToolCall] = useState<{
toolName: string;

View File

@@ -20,7 +20,7 @@ interface OrchestratorMessagesViewProps {
export const OrchestratorMessagesView = forwardRef<ScrollView, OrchestratorMessagesViewProps>(
function OrchestratorMessagesView({ messages, currentAssistantMessage, onArtifactClick }, ref) {
const { theme } = useUnistyles();
const bottomSheetRef = useRef<BottomSheetModal>(null);
const bottomSheetRef = useRef<BottomSheetModal | null>(null);
const [selectedToolCall, setSelectedToolCall] = useState<{
toolName: string;
status: 'executing' | 'completed' | 'failed';

View File

@@ -9,7 +9,7 @@ import {
} from "@gorhom/bottom-sheet";
interface ToolCallBottomSheetProps {
bottomSheetRef: React.RefObject<BottomSheetModal>;
bottomSheetRef: React.RefObject<BottomSheetModal | null>;
toolName?: string;
status?: "pending" | "in_progress" | "executing" | "completed" | "failed";
args?: any;

View File

@@ -50,7 +50,7 @@ export function useAudioPlayer() {
const [audioInitialized, setAudioInitialized] = useState(false);
const queueRef = useRef<QueuedAudio[]>([]);
const isProcessingQueueRef = useRef(false);
const playbackTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const playbackTimeoutRef = useRef<number | null>(null);
async function play(audioData: Blob): Promise<number> {
return new Promise((resolve, reject) => {