don't render expired uploads
This commit is contained in:
parent
9989f944c3
commit
32a55d00b2
|
@ -18,6 +18,7 @@ module.exports = function(state, emit) {
|
|||
}
|
||||
|
||||
const archives = state.storage.files
|
||||
.filter(archive => !archive.expired)
|
||||
.map(archive => archiveTile(state, emit, archive))
|
||||
.reverse();
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ const modal = require('./modal');
|
|||
const intro = require('./intro');
|
||||
|
||||
module.exports = function(state, emit) {
|
||||
const archives = state.storage.files.map(archive =>
|
||||
archiveTile(state, emit, archive)
|
||||
);
|
||||
const archives = state.storage.files
|
||||
.filter(archive => !archive.expired)
|
||||
.map(archive => archiveTile(state, emit, archive));
|
||||
let left = '';
|
||||
if (state.uploading) {
|
||||
left = archiveTile.uploading(state, emit);
|
||||
|
@ -29,5 +29,6 @@ module.exports = function(state, emit) {
|
|||
<div class="md:mr-6 md:w-1/2">${left}</div>
|
||||
<div class="md:w-1/2 mt-6 md:mt-0">${right}</div>
|
||||
</section>
|
||||
</main>`;
|
||||
</main>
|
||||
`;
|
||||
};
|
||||
|
|
16
app/utils.js
16
app/utils.js
|
@ -184,8 +184,17 @@ async function streamToArrayBuffer(stream, size) {
|
|||
}
|
||||
|
||||
function list(items, ulStyle = '', liStyle = '') {
|
||||
const lis = items.map(i => html`<li class="${liStyle}">${i}</li>`);
|
||||
return html`<ul class="${ulStyle}">${lis}</ul>`;
|
||||
const lis = items.map(
|
||||
i =>
|
||||
html`
|
||||
<li class="${liStyle}">${i}</li>
|
||||
`
|
||||
);
|
||||
return html`
|
||||
<ul class="${ulStyle}">
|
||||
${lis}
|
||||
</ul>
|
||||
`;
|
||||
}
|
||||
|
||||
function secondsToL10nId(seconds) {
|
||||
|
@ -199,6 +208,9 @@ function secondsToL10nId(seconds) {
|
|||
}
|
||||
|
||||
function timeLeft(milliseconds) {
|
||||
if (milliseconds < 1) {
|
||||
return { id: 'linkExpiredAlt' };
|
||||
}
|
||||
const minutes = Math.floor(milliseconds / 1000 / 60);
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const days = Math.floor(hours / 24);
|
||||
|
|
Loading…
Reference in New Issue