From 06b25dcba6ee827681f5161d9d0c3183e7c6120d Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Tue, 8 Jan 2019 11:24:07 -0800 Subject: [PATCH] fixed initial page load rendering for expired downloads and when the upload list isn't empty. fixes #1069 and fixes #1021 --- app/ui/blank.js | 7 ++++++- app/ui/download.js | 4 ++++ server/routes/pages.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/ui/blank.js b/app/ui/blank.js index 8364ca80..8eb4e26c 100644 --- a/app/ui/blank.js +++ b/app/ui/blank.js @@ -2,6 +2,11 @@ const html = require('choo/html'); module.exports = function() { return html` -
+
+
+
+
+
+
`; }; diff --git a/app/ui/download.js b/app/ui/download.js index 06e94804..2650eaee 100644 --- a/app/ui/download.js +++ b/app/ui/download.js @@ -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) { diff --git a/server/routes/pages.js b/server/routes/pages.js index dd54d25b..b923967b 100644 --- a/server/routes/pages.js +++ b/server/routes/pages.js @@ -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) {