fix switching page causes setting to crash
This commit is contained in:
parent
880cfeddee
commit
639dcf0f07
|
@ -26,6 +26,9 @@ const SET_CONCURRENT_WORKERS_MUTATION = gql`
|
||||||
const ScannerConcurrentWorkers = () => {
|
const ScannerConcurrentWorkers = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
const workerAmountServerValue = useRef<null | number>(null)
|
||||||
|
const [workerAmount, setWorkerAmount] = useState(0)
|
||||||
|
|
||||||
const workerAmountQuery = useQuery<concurrentWorkersQuery>(
|
const workerAmountQuery = useQuery<concurrentWorkersQuery>(
|
||||||
CONCURRENT_WORKERS_QUERY,
|
CONCURRENT_WORKERS_QUERY,
|
||||||
{
|
{
|
||||||
|
@ -41,9 +44,6 @@ const ScannerConcurrentWorkers = () => {
|
||||||
setConcurrentWorkersVariables
|
setConcurrentWorkersVariables
|
||||||
>(SET_CONCURRENT_WORKERS_MUTATION)
|
>(SET_CONCURRENT_WORKERS_MUTATION)
|
||||||
|
|
||||||
const workerAmountServerValue = useRef<null | number>(null)
|
|
||||||
const [workerAmount, setWorkerAmount] = useState(0)
|
|
||||||
|
|
||||||
const updateWorkerAmount = (workerAmount: number) => {
|
const updateWorkerAmount = (workerAmount: number) => {
|
||||||
if (workerAmountServerValue.current != workerAmount) {
|
if (workerAmountServerValue.current != workerAmount) {
|
||||||
workerAmountServerValue.current = workerAmount
|
workerAmountServerValue.current = workerAmount
|
||||||
|
|
Loading…
Reference in New Issue