| @@ -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' |