(e)
| 468 | }); |
| 469 | |
| 470 | export function handleDownloadMultiSelected(e) { |
| 471 | if (e) { |
| 472 | e.preventDefault(); |
| 473 | e.stopImmediatePropagation(); |
| 474 | } |
| 475 | const files = getSelectedFileObjects(); |
| 476 | if (!files.length) { |
| 477 | showToast(t('no_files_selected_for_download'), 'warning'); |
| 478 | return; |
| 479 | } |
| 480 | |
| 481 | const limit = getDownloadLimit(); |
| 482 | const caps = window.currentFolderCaps || null; |
| 483 | const inEncryptedFolder = !!(caps && caps.encryption && caps.encryption.encrypted); |
| 484 | |
| 485 | // In encrypted folders, archive creation is disabled. Allow plain downloads up to the limit only. |
| 486 | if (inEncryptedFolder) { |
| 487 | if (files.length > limit) { |
| 488 | showToast(t('encrypted_download_limit', { limit }), 'warning'); |
| 489 | return; |
| 490 | } |
| 491 | downloadSelectedFilesIndividually(files); |
| 492 | return; |
| 493 | } |
| 494 | |
| 495 | // Normal behavior: download individually up to the limit; archive for more than the limit. |
| 496 | if (files.length > limit) { |
| 497 | handleDownloadZipSelected(e || new Event("click")); |
| 498 | return; |
| 499 | } |
| 500 | |
| 501 | downloadSelectedFilesIndividually(files); |
| 502 | } |
| 503 | |
| 504 | attachEnterKeyListener("downloadZipModal", "confirmDownloadZip"); |
| 505 | export function handleDownloadZipSelected(e) { |
nothing calls this directly
no test coverage detected