fix: add spinning when generate pdf
This commit is contained in:
parent
9a91727c98
commit
9b7c32ac04
@ -18,13 +18,13 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
const isGeneratedRef = useRef(false)
|
const isGeneratedRef = useRef(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsShow(true)
|
|
||||||
if (isLoadingSurveyDetail || !surveyDetail || isGeneratedRef.current) return
|
if (isLoadingSurveyDetail || !surveyDetail || isGeneratedRef.current) return
|
||||||
isGeneratedRef.current = true
|
isGeneratedRef.current = true
|
||||||
handleDownPdf()
|
handleDownPdf()
|
||||||
}, [surveyDetail?.id, isLoadingSurveyDetail])
|
}, [surveyDetail?.id, isLoadingSurveyDetail])
|
||||||
|
|
||||||
const handleDownPdf = () => {
|
const handleDownPdf = () => {
|
||||||
|
setIsShow(true)
|
||||||
const options = {
|
const options = {
|
||||||
method: 'open' as const,
|
method: 'open' as const,
|
||||||
resolution: Resolution.HIGH,
|
resolution: Resolution.HIGH,
|
||||||
@ -330,7 +330,11 @@ export default function SurveySaleDownloadPdf() {
|
|||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{surveyDetail?.detailInfo?.constructionYear === '1' ? '新築' : `既築 (${surveyDetail?.detailInfo?.constructionYear}年)`}
|
{surveyDetail?.detailInfo?.constructionYear === '1'
|
||||||
|
? '新築'
|
||||||
|
: surveyDetail?.detailInfo?.constructionYearEtc
|
||||||
|
? `既築 (${surveyDetail?.detailInfo?.constructionYear}年)`
|
||||||
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user