mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-04-19 14:53:20 +02:00
Do not update Queue-preview when not shown
This commit is contained in:
parent
63b10600da
commit
1ed376ba47
@ -14,7 +14,7 @@ export default function QueuePopUp({connectedToBackend, children, apiUri, checkC
|
|||||||
const [queueListInterval, setQueueListInterval] = React.useState<number | undefined>(undefined);
|
const [queueListInterval, setQueueListInterval] = React.useState<number | undefined>(undefined);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(connectedToBackend) {
|
if(connectedToBackend && showQueuePopup) {
|
||||||
UpdateMonitoringJobsList();
|
UpdateMonitoringJobsList();
|
||||||
if(queueListInterval === undefined){
|
if(queueListInterval === undefined){
|
||||||
setQueueListInterval(setInterval(() => {
|
setQueueListInterval(setInterval(() => {
|
||||||
@ -25,7 +25,7 @@ export default function QueuePopUp({connectedToBackend, children, apiUri, checkC
|
|||||||
clearInterval(queueListInterval);
|
clearInterval(queueListInterval);
|
||||||
setQueueListInterval(undefined);
|
setQueueListInterval(undefined);
|
||||||
}
|
}
|
||||||
}, [connectedToBackend]);
|
}, [connectedToBackend, showQueuePopup]);
|
||||||
|
|
||||||
function UpdateMonitoringJobsList(){
|
function UpdateMonitoringJobsList(){
|
||||||
JobFunctions.GetJobsInState(apiUri, JobState.Waiting)
|
JobFunctions.GetJobsInState(apiUri, JobState.Waiting)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user