Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Ref #7686: Resetting Speech Recognizer properly after valid search co…
Browse files Browse the repository at this point in the history
…nditions (#7820)

Resetting Speech Recognizer properly after valid search conditions
  • Loading branch information
soner-yuksel authored Aug 2, 2023
1 parent 64afce9 commit 1127d32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ extension BrowserViewController: TopToolbarDelegate {
if let query = searchQuery {
self.submitSearchText(query)
}

self.speechRecognizer.clearSearch()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ class SpeechRecognizer: ObservableObject {
}
}

nonisolated private func clearSearch() {
nonisolated func clearSearch() {
Task { @MainActor in
transcript = " "
transcriptedIcon = "leo.microphone"
finalizedRecognition = (false, "")
animationType = .pulse(scale: 1)
isSilent = true
}
}

Expand Down

0 comments on commit 1127d32

Please sign in to comment.