mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-19 00:37:22 +01:00
Update Tasks.js
Fix for 100% cpu usage on browsers when loading this page
This commit is contained in:
@@ -72,7 +72,6 @@ export default function Tasks() {
|
||||
},
|
||||
}).then((response) =>{
|
||||
setTaskIntervals(response.data);
|
||||
getTaskSettings();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -122,10 +121,10 @@ export default function Tasks() {
|
||||
{task.type==='Job' ?
|
||||
<Dropdown className="w-100">
|
||||
<Dropdown.Toggle variant="outline-primary" id="dropdown-basic" className="w-100">
|
||||
{intervals.find((interval) => interval.value === (taskIntervals[task.name]?.Interval || 15)).display}
|
||||
{taskIntervals && intervals.find((interval) => interval.value === (taskIntervals[task.name]?.Interval || 15)).display}
|
||||
</Dropdown.Toggle>
|
||||
<Dropdown.Menu className="w-100" >
|
||||
{intervals.map((interval) => (
|
||||
{taskIntervals && intervals.map((interval) => (
|
||||
|
||||
<Dropdown.Item onClick={()=>updateTaskSettings(task.name,interval.value)} value={interval.value} key={interval.value}>{interval.display}</Dropdown.Item>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user