@@ -18,7 +18,7 @@ import {
18
18
} from "@mui/material" ;
19
19
import { Add , Remove } from "@mui/icons-material" ;
20
20
import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter" ;
21
- import { Link } from "react-router-dom" ;
21
+ import { Link , useNavigate } from "react-router-dom" ;
22
22
import { CollapsibleBox , TitledBox } from "@/components" ;
23
23
import {
24
24
FrequencyRangeList ,
@@ -396,6 +396,7 @@ const StatusBarSettingsInfo = () => {
396
396
} ;
397
397
398
398
export const Settings = ( ) => {
399
+ const navigate = useNavigate ( ) ;
399
400
// Get all necessary state from the settings store
400
401
const settings = useSettingsStore ( ( state ) => state . settings ) ;
401
402
const uploadSettings = useSettingsStore ( ( state ) => state . uploadSettings ) ;
@@ -437,8 +438,9 @@ export const Settings = () => {
437
438
} , true ) ; // validateOnly = true
438
439
} ;
439
440
440
- const handleSaveSettings = ( ) => {
441
+ const saveAndStream = ( ) => {
441
442
uploadSettings ( ( ) => settings ) ;
443
+ navigate ( '/dashboard' ) ;
442
444
} ;
443
445
444
446
const handleResetSettings = async ( ) => {
@@ -595,19 +597,10 @@ export const Settings = () => {
595
597
< Button
596
598
variant = "contained"
597
599
color = "primary"
598
- onClick = { handleSaveSettings }
600
+ onClick = { saveAndStream }
599
601
disabled = { validationErrors }
600
602
>
601
- Save Settings
602
- </ Button >
603
- < Button
604
- variant = "contained"
605
- component = { Link }
606
- color = "primary"
607
- to = "/dashboard"
608
- disabled = { validationErrors }
609
- >
610
- Run Stream
603
+ Save & Run Stream
611
604
</ Button >
612
605
</ Stack >
613
606
</ Stack >
0 commit comments