fix: correct typescript ref types for bottom sheet and audio player
This commit is contained in:
@@ -42,7 +42,7 @@ export function AgentStreamView({
|
|||||||
onPermissionResponse,
|
onPermissionResponse,
|
||||||
}: AgentStreamViewProps) {
|
}: AgentStreamViewProps) {
|
||||||
const scrollViewRef = useRef<ScrollView>(null);
|
const scrollViewRef = useRef<ScrollView>(null);
|
||||||
const bottomSheetRef = useRef<BottomSheetModal>(null);
|
const bottomSheetRef = useRef<BottomSheetModal | null>(null);
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const [selectedToolCall, setSelectedToolCall] = useState<{
|
const [selectedToolCall, setSelectedToolCall] = useState<{
|
||||||
toolName: string;
|
toolName: string;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ interface OrchestratorMessagesViewProps {
|
|||||||
export const OrchestratorMessagesView = forwardRef<ScrollView, OrchestratorMessagesViewProps>(
|
export const OrchestratorMessagesView = forwardRef<ScrollView, OrchestratorMessagesViewProps>(
|
||||||
function OrchestratorMessagesView({ messages, currentAssistantMessage, onArtifactClick }, ref) {
|
function OrchestratorMessagesView({ messages, currentAssistantMessage, onArtifactClick }, ref) {
|
||||||
const { theme } = useUnistyles();
|
const { theme } = useUnistyles();
|
||||||
const bottomSheetRef = useRef<BottomSheetModal>(null);
|
const bottomSheetRef = useRef<BottomSheetModal | null>(null);
|
||||||
const [selectedToolCall, setSelectedToolCall] = useState<{
|
const [selectedToolCall, setSelectedToolCall] = useState<{
|
||||||
toolName: string;
|
toolName: string;
|
||||||
status: 'executing' | 'completed' | 'failed';
|
status: 'executing' | 'completed' | 'failed';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from "@gorhom/bottom-sheet";
|
} from "@gorhom/bottom-sheet";
|
||||||
|
|
||||||
interface ToolCallBottomSheetProps {
|
interface ToolCallBottomSheetProps {
|
||||||
bottomSheetRef: React.RefObject<BottomSheetModal>;
|
bottomSheetRef: React.RefObject<BottomSheetModal | null>;
|
||||||
toolName?: string;
|
toolName?: string;
|
||||||
status?: "pending" | "in_progress" | "executing" | "completed" | "failed";
|
status?: "pending" | "in_progress" | "executing" | "completed" | "failed";
|
||||||
args?: any;
|
args?: any;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export function useAudioPlayer() {
|
|||||||
const [audioInitialized, setAudioInitialized] = useState(false);
|
const [audioInitialized, setAudioInitialized] = useState(false);
|
||||||
const queueRef = useRef<QueuedAudio[]>([]);
|
const queueRef = useRef<QueuedAudio[]>([]);
|
||||||
const isProcessingQueueRef = useRef(false);
|
const isProcessingQueueRef = useRef(false);
|
||||||
const playbackTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
const playbackTimeoutRef = useRef<number | null>(null);
|
||||||
|
|
||||||
async function play(audioData: Blob): Promise<number> {
|
async function play(audioData: Blob): Promise<number> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user