PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← 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