Skip to content

Commit

Permalink
Update Settings component to have only 'Save & Run Stream' button
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedtarek- committed Feb 5, 2025
1 parent 100ebed commit dbedec2
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions gui_dev/src/pages/Settings/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "@mui/material";
import { Add, Remove } from "@mui/icons-material";
import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
import { Link } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";
import { CollapsibleBox, TitledBox } from "@/components";
import {
FrequencyRangeList,
Expand Down Expand Up @@ -396,6 +396,7 @@ const StatusBarSettingsInfo = () => {
};

export const Settings = () => {
const navigate = useNavigate();
// Get all necessary state from the settings store
const settings = useSettingsStore((state) => state.settings);
const uploadSettings = useSettingsStore((state) => state.uploadSettings);
Expand Down Expand Up @@ -437,8 +438,9 @@ export const Settings = () => {
}, true); // validateOnly = true
};

const handleSaveSettings = () => {
const saveAndStream = () => {
uploadSettings(() => settings);
navigate('/dashboard');
};

const handleResetSettings = async () => {
Expand Down Expand Up @@ -595,19 +597,10 @@ export const Settings = () => {
<Button
variant="contained"
color="primary"
onClick={handleSaveSettings}
onClick={saveAndStream}
disabled={validationErrors}
>
Save Settings
</Button>
<Button
variant="contained"
component={Link}
color="primary"
to="/dashboard"
disabled={validationErrors}
>
Run Stream
Save & Run Stream
</Button>
</Stack>
</Stack>
Expand Down

0 comments on commit dbedec2

Please sign in to comment.