fixed initial page load rendering for expired downloads and when the upload list isn't empty. fixes #1069 and fixes #1021

This commit is contained in:
Danny Coates 2019-01-08 11:24:07 -08:00
parent e1bbff0047
commit 06b25dcba6
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
3 changed files with 11 additions and 2 deletions

View File

@ -2,6 +2,11 @@ const html = require('choo/html');
module.exports = function() {
return html`
<main class="main container"></main>
<main class="main relative">
<section class="h-full w-full p-6 md:flex md:flex-row z-10">
<div class="md:mr-6 md:w-1/2 w-full"></div>
<div class="md:w-1/2 mt-6 md:mt-0 w-full"></div>
</section>
</main>
`;
};

View File

@ -2,6 +2,7 @@
const html = require('choo/html');
const archiveTile = require('./archiveTile');
const intro = require('./intro');
const notFound = require('./notFound');
function password(state, emit) {
const fileInfo = state.fileInfo;
@ -81,6 +82,9 @@ module.exports = function(state, emit) {
let content = '';
if (!state.fileInfo) {
state.fileInfo = createFileInfo(state);
if (!state.fileInfo.nonce) {
return notFound(state);
}
}
if (!state.transfer && !state.fileInfo.requiresPassword) {

View File

@ -11,7 +11,7 @@ function stripEvents(str) {
module.exports = {
index: async function(req, res) {
const appState = await state(req);
res.send(stripEvents(routes().toString('/', appState)));
res.send(stripEvents(routes().toString('/blank', appState)));
},
blank: async function(req, res) {