@@ -36,6 +36,7 @@ import {
36
36
import { useForm } from "react-hook-form" ;
37
37
import { z } from "zod" ;
38
38
import { Select } from "./ui/select" ;
39
+ import { toast } from "sonner" ;
39
40
40
41
export interface StreamConfig {
41
42
streamUrl : string ;
@@ -170,8 +171,12 @@ function ConfigForm({ config, onSubmit }: ConfigFormProps) {
170
171
if ( ! selectedDevice && videoDevices . length > 1 ) {
171
172
setSelectedDevice ( videoDevices [ 1 ] . deviceId ) ; // Index 1 because 0 is "No Video"
172
173
}
173
- } catch ( err ) {
174
- console . error ( "Failed to get video devices" ) ;
174
+ } catch ( error ) {
175
+ console . log ( `Failed to get video devices: ${ error } ` ) ;
176
+ toast . error ( "Failed to get video devices" , {
177
+ description : "Please make sure your camera is connected and enabled." ,
178
+ } ) ;
179
+
175
180
// If we can't access video devices, still provide the None option
176
181
const videoDevices = [ { deviceId : "none" , label : "No Video" } ] ;
177
182
setVideoDevices ( videoDevices ) ;
@@ -197,8 +202,12 @@ function ConfigForm({ config, onSubmit }: ConfigFormProps) {
197
202
if ( ! selectedAudioDevice && audioDevices . length > 1 ) {
198
203
setSelectedAudioDevice ( audioDevices [ 0 ] . deviceId ) ; // Default to "No Audio" for now
199
204
}
200
- } catch ( err ) {
201
- console . error ( "Failed to get audio devices" ) ;
205
+ } catch ( error ) {
206
+ console . error ( "Failed to get audio devices: " , error ) ;
207
+ toast . error ( "Failed to get audio devices" , {
208
+ description : "Please make sure your microphone is connected and enabled." ,
209
+ } ) ;
210
+
202
211
// If we can't access audio devices, still provide the None option
203
212
const audioDevices = [ { deviceId : "none" , label : "No Audio" } ] ;
204
213
setAudioDevices ( audioDevices ) ;
@@ -252,6 +261,9 @@ function ConfigForm({ config, onSubmit }: ConfigFormProps) {
252
261
setOriginalPrompts ( allPrompts ) ;
253
262
} catch ( err ) {
254
263
console . error ( "Failed to parse one or more JSON files." , err ) ;
264
+ toast . error ( "Failed to Parse Workflow" , {
265
+ description : "Please upload a valid JSON file." ,
266
+ } ) ;
255
267
}
256
268
} ;
257
269
0 commit comments