MCPcopy Create free account
hub / github.com/error311/FileRise / handleDownloadMultiSelected

Function handleDownloadMultiSelected

public/js/fileActions.js:470–502  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

468});
469
470export 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
504attachEnterKeyListener("downloadZipModal", "confirmDownloadZip");
505export function handleDownloadZipSelected(e) {

Callers

nothing calls this directly

Calls 6

getSelectedFileObjectsFunction · 0.85
tFunction · 0.85
getDownloadLimitFunction · 0.85
showToastFunction · 0.70

Tested by

no test coverage detected