diff --git a/src/pages/FileDownload.jsx b/src/pages/FileDownload.jsx index 9995ae9..496826b 100644 --- a/src/pages/FileDownload.jsx +++ b/src/pages/FileDownload.jsx @@ -1,5 +1,5 @@ import { Link, useLocation, useNavigate, useParams } from 'react-router-dom' -import { memo, useCallback, useEffect, useState } from 'react' +import { memo, useCallback, useEffect, useMemo, useState } from 'react' import { InfoCircleFilled, CloseCircleOutlined } from '@ant-design/icons' import { Button, Result, Typography } from 'antd' @@ -21,7 +21,7 @@ const FileDownload = memo(function FileDownload() { const navigate = useNavigate() const location = useLocation() - const isFirstOpenApp = location.key === 'default' + const isFirstOpenApp = useMemo(() => location.key === 'default', [location]) useEffect(() => { invokeWebApiWrapperAsync( @@ -45,7 +45,7 @@ const FileDownload = memo(function FileDownload() { }, { actionName: 'Получение информации о файле' } ) - }, [idWell, idFile]) + }, [idFile]) const download = useCallback(async () => { if (!file || !await downloadFile(file))