File tree 1 file changed +15
-16
lines changed
1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -103,22 +103,21 @@ function App() {
103
103
console .log (" error code:" , event .error , " error messsage:" , event .message );
104
104
});
105
105
106
- const handleStart = () => {
107
- ExpoSpeechRecognitionModule .requestPermissionsAsync ().then ((result ) => {
108
- if (! result .granted ) {
109
- console .warn (" Permissions not granted" , result );
110
- return ;
111
- }
112
- // Start speech recognition
113
- ExpoSpeechRecognitionModule .start ({
114
- lang: " en-US" ,
115
- interimResults: true ,
116
- maxAlternatives: 1 ,
117
- continuous: false ,
118
- requiresOnDeviceRecognition: false ,
119
- addsPunctuation: false ,
120
- contextualStrings: [" Carlsen" , " Nepomniachtchi" , " Praggnanandhaa" ],
121
- });
106
+ const handleStart = async () => {
107
+ const result = await ExpoSpeechRecognitionModule .requestPermissionsAsync ();
108
+ if (! result .granted ) {
109
+ console .warn (" Permissions not granted" , result );
110
+ return ;
111
+ }
112
+ // Start speech recognition
113
+ ExpoSpeechRecognitionModule .start ({
114
+ lang: " en-US" ,
115
+ interimResults: true ,
116
+ maxAlternatives: 1 ,
117
+ continuous: false ,
118
+ requiresOnDeviceRecognition: false ,
119
+ addsPunctuation: false ,
120
+ contextualStrings: [" Carlsen" , " Nepomniachtchi" , " Praggnanandhaa" ],
122
121
});
123
122
};
124
123
You can’t perform that action at this time.
0 commit comments