PluginProbe
Code Snippets / 4.0.0-beta.3
Code Snippets v4.0.0-beta.3
4.0.0-beta.3 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 All 66 releases
← All changes | js/utils/files.ts +2 -3 4.0.0-beta.2 → 4.0.0-beta.3 View file →
@@ -1,10 +1,9 @@
1 +import { TIMEOUTS } from '../../../tests/e2e/helpers/constants'
1 2 import { getSnippetType } from './snippets/snippets'
2 3 import type { SnippetsExport } from '../types/schema/SnippetsExport'
3 4 import type { Snippet } from '../types/Snippet'
4 5
5 -const SECOND_IN_MS = 1000
6 -const TIMEOUT_SECONDS = 40
7 6 const JSON_INDENT_SPACES = 2
8 7 const EXPORT_FILENAME = 'snippets'
9 8 const EXPORT_GENERATOR = 'Code Snippets'
10 9 const DEFAULT_PRIORITY = 10
@@ -23,9 +22,9 @@
23 22 const link = document.createElement('a')
24 23 link.download = filename
25 24 link.href = URL.createObjectURL(new Blob([content], { type }))
26 25
27 - setTimeout(() => URL.revokeObjectURL(link.href), TIMEOUT_SECONDS * SECOND_IN_MS)
26 + setTimeout(() => URL.revokeObjectURL(link.href), TIMEOUTS.DEFAULT)
28 27
29 28 // Some browsers (notably headless Chromium) can ignore programmatic clicks on detached anchors.
30 29 // Appending the link to the DOM before clicking improves reliability.
31 30 link.style.display = 'none'