MCPcopy
hub / github.com/TTLabs/EvaporateJS / getSavedUploads

Function getSavedUploads

evaporate.js:2043–2063  ·  view source on GitHub ↗
(purge)

Source from the content-addressed store, hash-verified

2041 }
2042
2043 function getSavedUploads(purge) {
2044 var uploads = JSON.parse(historyCache.getItem('awsUploads') || '{}');
2045
2046 if (purge) {
2047 for (var key in uploads) {
2048 if (uploads.hasOwnProperty(key)) {
2049 var upload = uploads[key],
2050 completedAt = new Date(upload.completedAt || FAR_FUTURE);
2051
2052 if (completedAt < HOURS_AGO) {
2053 // The upload is recent, let's keep it
2054 delete uploads[key];
2055 }
2056 }
2057 }
2058
2059 historyCache.setItem('awsUploads', JSON.stringify(uploads));
2060 }
2061
2062 return uploads;
2063 }
2064
2065 function uploadKey(fileUpload) {
2066 // The key tries to give a signature to a file in the absence of its path.

Callers 3

evaporate.jsFile · 0.85
saveUploadFunction · 0.85
removeUploadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected