mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 21:19:18 +00:00
fix switching page causes setting to crash
This commit is contained in:
@@ -26,6 +26,9 @@ const SET_CONCURRENT_WORKERS_MUTATION = gql`
|
||||
const ScannerConcurrentWorkers = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const workerAmountServerValue = useRef<null | number>(null)
|
||||
const [workerAmount, setWorkerAmount] = useState(0)
|
||||
|
||||
const workerAmountQuery = useQuery<concurrentWorkersQuery>(
|
||||
CONCURRENT_WORKERS_QUERY,
|
||||
{
|
||||
@@ -41,9 +44,6 @@ const ScannerConcurrentWorkers = () => {
|
||||
setConcurrentWorkersVariables
|
||||
>(SET_CONCURRENT_WORKERS_MUTATION)
|
||||
|
||||
const workerAmountServerValue = useRef<null | number>(null)
|
||||
const [workerAmount, setWorkerAmount] = useState(0)
|
||||
|
||||
const updateWorkerAmount = (workerAmount: number) => {
|
||||
if (workerAmountServerValue.current != workerAmount) {
|
||||
workerAmountServerValue.current = workerAmount
|
||||
|
||||
Reference in New Issue
Block a user