Skip to content

Commit dbedec2

Browse files
committed
Update Settings component to have only 'Save & Run Stream' button
1 parent 100ebed commit dbedec2

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

gui_dev/src/pages/Settings/Settings.jsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from "@mui/material";
1919
import { Add, Remove } from "@mui/icons-material";
2020
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";
2222
import { CollapsibleBox, TitledBox } from "@/components";
2323
import {
2424
FrequencyRangeList,
@@ -396,6 +396,7 @@ const StatusBarSettingsInfo = () => {
396396
};
397397

398398
export const Settings = () => {
399+
const navigate = useNavigate();
399400
// Get all necessary state from the settings store
400401
const settings = useSettingsStore((state) => state.settings);
401402
const uploadSettings = useSettingsStore((state) => state.uploadSettings);
@@ -437,8 +438,9 @@ export const Settings = () => {
437438
}, true); // validateOnly = true
438439
};
439440

440-
const handleSaveSettings = () => {
441+
const saveAndStream = () => {
441442
uploadSettings(() => settings);
443+
navigate('/dashboard');
442444
};
443445

444446
const handleResetSettings = async () => {
@@ -595,19 +597,10 @@ export const Settings = () => {
595597
<Button
596598
variant="contained"
597599
color="primary"
598-
onClick={handleSaveSettings}
600+
onClick={saveAndStream}
599601
disabled={validationErrors}
600602
>
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
611604
</Button>
612605
</Stack>
613606
</Stack>

0 commit comments

Comments
 (0)