nit: use 'html/raw' instead of html() where possible

This commit is contained in:
Danny Coates 2018-02-11 14:02:40 -08:00
parent 950c9cdaeb
commit dcfda9521b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 14 additions and 11 deletions

View file

@ -1,5 +1,6 @@
/* global EXPIRE_SECONDS */
const html = require('choo/html');
const raw = require('choo/html/raw');
const assets = require('../../common/assets');
const notFound = require('./notFound');
const uploadPasswordSet = require('../templates/uploadPasswordSet');
@ -9,12 +10,12 @@ const { allowedCopy, delay, fadeOut } = require('../utils');
function expireInfo(file, translate, emit) {
const hours = Math.floor(EXPIRE_SECONDS / 60 / 60);
const el = html([
`<div>${translate('expireInfo', {
const el = html`<div>${raw(
translate('expireInfo', {
downloadCount: '<select></select>',
timespan: translate('timespanHours', { num: hours })
})}</div>`
]);
})
)}</div>`;
const select = el.querySelector('select');
const options = [1, 2, 3, 4, 5, 20].filter(i => i > (file.dtotal || 0));
const t = num => translate('downloadCount', { num });