disable button when downloading

This commit is contained in:
Krishav Raj Singh 2025-08-25 21:55:19 +05:30
parent 7c7c05228e
commit 83fd5196eb
2 changed files with 6 additions and 4 deletions

View File

@ -420,6 +420,7 @@ export function FullScreenPresentationViewer({
size="sm"
className="h-8 w-8 p-0"
title="Export presentation"
disabled={isDownloadingPDF || isDownloadingPPTX}
>
{(isDownloadingPDF || isDownloadingPPTX) ? (
<Loader2 className="h-3.5 w-3.5 animate-spin" />
@ -429,11 +430,11 @@ export function FullScreenPresentationViewer({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-32">
<DropdownMenuItem className="cursor-pointer" onClick={() => onPDFDownload(setIsDownloadingPDF)}>
<DropdownMenuItem className="cursor-pointer" onClick={() => onPDFDownload(setIsDownloadingPDF)} disabled={isDownloadingPDF}>
<FileText className="h-4 w-4 mr-2" />
PDF
</DropdownMenuItem>
<DropdownMenuItem className="cursor-pointer" onClick={() => onPPTXDownload(setIsDownloadingPPTX)}>
<DropdownMenuItem className="cursor-pointer" onClick={() => onPPTXDownload(setIsDownloadingPPTX)} disabled={isDownloadingPPTX}>
<Presentation className="h-4 w-4 mr-2" />
PPTX
</DropdownMenuItem>

View File

@ -604,6 +604,7 @@ export function PresentationViewer({
size="sm"
className="h-8 w-8 p-0"
title="Export presentation"
disabled={isDownloadingPDF || isDownloadingPPTX}
>
{(isDownloadingPDF || isDownloadingPPTX) ? (
<Loader2 className="h-3.5 w-3.5 animate-spin" />
@ -616,7 +617,7 @@ export function PresentationViewer({
<DropdownMenuItem
onClick={() => handlePDFDownload(setIsDownloadingPDF)}
className="cursor-pointer"
disabled={isDownloadingPPTX}
disabled={isDownloadingPDF}
>
<FileText className="h-4 w-4 mr-2" />
PDF
@ -624,7 +625,7 @@ export function PresentationViewer({
<DropdownMenuItem
onClick={() => handlePPTXDownload(setIsDownloadingPPTX)}
className="cursor-pointer"
disabled={isDownloadingPDF}
disabled={isDownloadingPPTX}
>
<Presentation className="h-4 w-4 mr-2" />
PPTX