Skip to content

Commit

Permalink
omg i dont want to work on this anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Blanc committed Oct 30, 2023
1 parent 30fcd0c commit 5ea5ffb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions frontend/src/pages/components/settings/Tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export default function Tasks() {
const [processing, setProcessing] = useState(false);
const [taskIntervals, setTaskIntervals] = useState([]);
const token = localStorage.getItem("token");
const intervals = [
{ value: 15, display: "15 Minutes" },
{ value: 30, display: "30 Minutes" },
{ value: 60, display: "1 Hour" },
{ value: 1440, display: "1 Day" },
];

async function executeTask(url) {
setProcessing(true);
Expand Down Expand Up @@ -52,6 +58,9 @@ export default function Tasks() {
},
},
)
.then((response) => {
setTaskIntervals(response.data)
})
.catch((error) => {
console.log(error);
});
Expand All @@ -67,7 +76,6 @@ export default function Tasks() {
})
.then((response) => {
setTaskIntervals(response.data);
getTaskSettings();
})
.catch((error) => {
console.log(error);
Expand All @@ -78,12 +86,6 @@ export default function Tasks() {
getTaskSettings();
}

const intervals = [
{ value: 15, display: "15 Minutes" },
{ value: 30, display: "30 Minutes" },
{ value: 60, display: "1 Hour" },
{ value: 1440, display: "1 Day" },
];

return (
<div className="tasks">
Expand Down

0 comments on commit 5ea5ffb

Please sign in to comment.