Skip to content

Commit d30c37c

Browse files
committed
Fix preconnect
1 parent 7b7f9f5 commit d30c37c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

VoiceAgent/Agent/AgentSession.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ final class AgentSession: ObservableObject {
122122

123123
do {
124124
if preConnectAudio {
125-
try await room.withPreConnectAudio { try await connection() }
125+
try await room.withPreConnectAudio(timeout: waitForAgent) {
126+
await MainActor.run { self.isListening = true }
127+
try await connection()
128+
await MainActor.run { self.isListening = false }
129+
}
126130
} else {
127131
try await connection()
128132
}

VoiceAgent/App/AppView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct AppView: View {
4444
.animation(.default, value: session.isScreenShareEnabled)
4545
.animation(.default, value: session.error?.localizedDescription)
4646
#if os(iOS)
47-
.sensoryFeedback(.impact, trigger: session.isListening)
47+
.sensoryFeedback(.impact, trigger: session.isListening) { !$0 && $1 }
4848
#endif
4949
}
5050

0 commit comments

Comments
 (0)