Skip to content

Commit 522892e

Browse files
committed
fix(example): set error & status idle after permissions not granted
1 parent 4db9769 commit 522892e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

example/App.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,13 @@ export default function App() {
123123
setTranscription(null);
124124
setError(null);
125125
setStatus("starting");
126+
126127
ExpoSpeechRecognitionModule.requestPermissionsAsync().then((result) => {
127128
console.log("Permissions", result);
128129
if (!result.granted) {
129130
console.log("Permissions not granted", result);
131+
setError({ error: "not-allowed", message: "Permissions not granted" });
132+
setStatus("idle");
130133
return;
131134
}
132135
ExpoSpeechRecognitionModule.start(settings);

0 commit comments

Comments
 (0)