На странице скачивания файла исправлено название файла и переход на предыдущую страницу

This commit is contained in:
ts_salikhov 2022-10-17 17:19:13 +04:00
parent 1a4189901a
commit 53a1d33a55

View File

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