Skip to content

Commit 8f4a726

Browse files
committed
chore: add return type to function
1 parent f31a282 commit 8f4a726

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Shared/Hooks/UseDownload/UseDownload.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const useDownload = () => {
2424
fileName,
2525
showSuccessfulToast = true,
2626
downloadSuccessToastContent = 'Downloaded Successfully',
27-
}: HandleDownloadProps) => {
27+
}: HandleDownloadProps): Promise<Error | ServerErrors> => {
2828
setIsDownloading(true)
2929
if (showFilePreparingToast) {
3030
toast.info(
@@ -70,10 +70,11 @@ const useDownload = () => {
7070
throw new ServerErrors(jsonResponseError)
7171
}
7272
} catch (error) {
73-
showError(error)
7473
setIsDownloading(false)
74+
showError(error)
7575
return error
7676
}
77+
setIsDownloading(false)
7778
return null
7879
}
7980

0 commit comments

Comments
 (0)