Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Use EXPIRE_SECONDS to calculate file ttl for static content #672

Merged
merged 1 commit into from
Dec 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/templates/share.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global EXPIRE_SECONDS */
const html = require('choo/html');
const assets = require('../../common/assets');
const notFound = require('./notFound');
Expand All @@ -16,10 +17,11 @@ function passwordComplete(state, password) {
}

function expireInfo(file, translate, emit) {
const hours = Math.floor(EXPIRE_SECONDS / 60 / 60);
const el = html([
`<div>${translate('expireInfo', {
downloadCount: '<select></select>',
timespan: translate('timespanHours', { num: 24 })
timespan: translate('timespanHours', { num: hours })
})}</div>`
]);
const select = el.querySelector('select');
Expand Down