@designcrowd/fe-shared-lib 1.8.7 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.8.7",
3
+ "version": "1.8.8",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -104,6 +104,8 @@ export function useVoiceToText(options: UseVoiceToTextOptions = {}): UseVoiceToT
104
104
  return;
105
105
  }
106
106
 
107
+ isListening.value = false;
108
+
107
109
  const message = ERROR_MESSAGES[event.error] || 'An error occurred with speech recognition.';
108
110
  error.value = message;
109
111
 
@@ -118,6 +120,10 @@ export function useVoiceToText(options: UseVoiceToTextOptions = {}): UseVoiceToT
118
120
  }, ERROR_CLEAR_DELAY);
119
121
  };
120
122
 
123
+ recognition.onstart = () => {
124
+ isListening.value = true;
125
+ };
126
+
121
127
  recognition.onend = () => {
122
128
  isListening.value = false;
123
129
  };
@@ -142,7 +148,6 @@ export function useVoiceToText(options: UseVoiceToTextOptions = {}): UseVoiceToT
142
148
 
143
149
  try {
144
150
  recognition.start();
145
- isListening.value = true;
146
151
  } catch (e: unknown) {
147
152
  // eslint-disable-next-line no-console
148
153
  console.warn('[useVoiceToText] Failed to start:', (e as Error).message);