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

Function finalizeCryptoJobUi

public/js/folderManager.js:3264–3311  ·  view source on GitHub ↗
({ folder, mode, jobId, ok, error })

Source from the content-addressed store, hash-verified

3262}
3263
3264function finalizeCryptoJobUi({ folder, mode, jobId, ok, error }) {
3265 try { localStorage.removeItem(CRYPTO_JOB_STORAGE_KEY); } catch (e) { }
3266 if (__cryptoRunner) {
3267 clearTimeout(__cryptoRunner);
3268 __cryptoRunner = null;
3269 }
3270
3271 // Update folder tree visuals best-effort
3272 if (mode === 'decrypt' && ok) {
3273 setEncryptedClassForRenderedSubtree(folder, false);
3274 } else if (mode === 'encrypt' && ok) {
3275 setEncryptedClassForRenderedSubtree(folder, true);
3276 }
3277
3278 try { invalidateFolderCaches(folder); } catch (e) { }
3279 try { refreshFolderIcon(folder); } catch (e) { }
3280 try { applyFolderCapabilities(folder); } catch (e) { }
3281 // If the current view is showing the affected folder (or its parent), refresh the list so
3282 // folder-row icons/capability-driven toolbar state update immediately.
3283 if (ok) {
3284 try {
3285 const cur = window.currentFolder || 'root';
3286 const parent = getParentFolder(folder || 'root');
3287 if (cur === (folder || 'root') || cur === parent) {
3288 loadFileList(cur);
3289 }
3290 } catch (e) { /* ignore */ }
3291 }
3292
3293 if (__cryptoTransferUiJob) {
3294 finishTransferProgress(__cryptoTransferUiJob, {
3295 ok: !!ok,
3296 error: error ? String(error) : '',
3297 state: ok ? 'done' : 'error'
3298 });
3299 __cryptoTransferUiJob = null;
3300 }
3301
3302 if (ok) {
3303 showToast(mode === 'decrypt' ? t('folder_decryption_completed') : t('folder_encryption_completed'), 'success');
3304 } else {
3305 if (error) {
3306 showToast(t('folder_crypto_failed_detail', { error }), 'error');
3307 } else {
3308 showToast(t('folder_crypto_failed'), 'error');
3309 }
3310 }
3311}
3312
3313export async function startFolderCryptoJobFlow(folder, mode) {
3314 try {

Callers 1

loopFunction · 0.85

Calls 9

invalidateFolderCachesFunction · 0.85
refreshFolderIconFunction · 0.85
applyFolderCapabilitiesFunction · 0.85
getParentFolderFunction · 0.85
loadFileListFunction · 0.85
finishTransferProgressFunction · 0.85
tFunction · 0.85
showToastFunction · 0.70

Tested by

no test coverage detected