(folder, mode, totalFiles = 0, totalBytes = 0)
| 3074 | } |
| 3075 | |
| 3076 | function ensureCryptoTransferUiJob(folder, mode, totalFiles = 0, totalBytes = 0) { |
| 3077 | if (__cryptoTransferUiJob) return __cryptoTransferUiJob; |
| 3078 | |
| 3079 | const act = mode === 'decrypt' ? 'Decrypting' : 'Encrypting'; |
| 3080 | const folderLabel = folder || 'root'; |
| 3081 | const fileCount = Number.isFinite(totalFiles) ? Math.max(0, Number(totalFiles)) : 0; |
| 3082 | const byteTotal = Number.isFinite(totalBytes) ? Math.max(0, Number(totalBytes)) : 0; |
| 3083 | |
| 3084 | __cryptoTransferUiJob = startTransferProgress({ |
| 3085 | action: act, |
| 3086 | title: `${act} ${folderLabel}`, |
| 3087 | subText: 'Running in the background. You can keep using FileRise.', |
| 3088 | itemCount: fileCount, |
| 3089 | itemLabel: fileCount === 1 ? 'file' : 'files', |
| 3090 | totalBytes: byteTotal, |
| 3091 | bytesKnown: byteTotal > 0, |
| 3092 | indeterminate: byteTotal <= 0 && fileCount <= 0, |
| 3093 | state: 'running' |
| 3094 | }); |
| 3095 | |
| 3096 | return __cryptoTransferUiJob; |
| 3097 | } |
| 3098 | |
| 3099 | function renderCryptoJobUi({ folder, mode, job }) { |
| 3100 | ensureCryptoJobUi(); |
no test coverage detected