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
|
const archives = state.storage.files
|
||||||
|
.filter(archive => !archive.expired)
|
||||||
.map(archive => archiveTile(state, emit, archive))
|
.map(archive => archiveTile(state, emit, archive))
|
||||||
.reverse();
|
.reverse();
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ const modal = require('./modal');
|
||||||
const intro = require('./intro');
|
const intro = require('./intro');
|
||||||
|
|
||||||
module.exports = function(state, emit) {
|
module.exports = function(state, emit) {
|
||||||
const archives = state.storage.files.map(archive =>
|
const archives = state.storage.files
|
||||||
archiveTile(state, emit, archive)
|
.filter(archive => !archive.expired)
|
||||||
);
|
.map(archive => archiveTile(state, emit, archive));
|
||||||
let left = '';
|
let left = '';
|
||||||
if (state.uploading) {
|
if (state.uploading) {
|
||||||
left = archiveTile.uploading(state, emit);
|
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:mr-6 md:w-1/2">${left}</div>
|
||||||
<div class="md:w-1/2 mt-6 md:mt-0">${right}</div>
|
<div class="md:w-1/2 mt-6 md:mt-0">${right}</div>
|
||||||
</section>
|
</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 = '') {
|
function list(items, ulStyle = '', liStyle = '') {
|
||||||
const lis = items.map(i => html`<li class="${liStyle}">${i}</li>`);
|
const lis = items.map(
|
||||||
return html`<ul class="${ulStyle}">${lis}</ul>`;
|
i =>
|
||||||
|
html`
|
||||||
|
<li class="${liStyle}">${i}</li>
|
||||||
|
`
|
||||||
|
);
|
||||||
|
return html`
|
||||||
|
<ul class="${ulStyle}">
|
||||||
|
${lis}
|
||||||
|
</ul>
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function secondsToL10nId(seconds) {
|
function secondsToL10nId(seconds) {
|
||||||
|
@ -199,6 +208,9 @@ function secondsToL10nId(seconds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function timeLeft(milliseconds) {
|
function timeLeft(milliseconds) {
|
||||||
|
if (milliseconds < 1) {
|
||||||
|
return { id: 'linkExpiredAlt' };
|
||||||
|
}
|
||||||
const minutes = Math.floor(milliseconds / 1000 / 60);
|
const minutes = Math.floor(milliseconds / 1000 / 60);
|
||||||
const hours = Math.floor(minutes / 60);
|
const hours = Math.floor(minutes / 60);
|
||||||
const days = Math.floor(hours / 24);
|
const days = Math.floor(hours / 24);
|
||||||
|
|
Loading…
Reference in New Issue