← All changes
|
js/components/common/cloud/CloudSnippetDownloadButton.tsx
+2
-2
3.10.2
→
4.0.0-beta.2
View file →
| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | link_id: number |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | export interface CloudSnippetDownloadButtonProps { |
| 21 | - onDownloaded: VoidFunction | |
| 21 | + onDownloaded?: VoidFunction | |
| 22 | 22 | snippet: CloudSnippetSchema |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | export const CloudSnippetDownloadButton: React.FC<CloudSnippetDownloadButtonProps> = ({ snippet, onDownloaded }) => { |
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | |
| 56 | 56 | api.post<DownloadSnippetResponse>(`${REST_BASES.cloud.snippets}/${snippet.id}/download`) |
| 57 | 57 | .then(response => { |
| 58 | 58 | updateDownloadRecord(snippet.id, { localId: response.snippet_id }) |
| 59 | - onDownloaded() | |
| 59 | + onDownloaded?.() | |
| 60 | 60 | }) |
| 61 | 61 | .catch((error: unknown) => { |
| 62 | 62 | setErrorMessage('string' === typeof error |
| 63 | 63 | ? error |