diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 1c1a43bff..abece3af6 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -581,6 +581,7 @@ define(function () { out.upload_mustLogin = "You must be logged in to upload files"; out.download_button = "Decrypt & Download"; out.download_mt_button = "Download"; + out.download_resourceNotAvailable = "The requested resource was not available..."; out.todo_title = "CryptTodo"; out.todo_newTodoNamePlaceholder = "Describe your task..."; diff --git a/www/file/inner.js b/www/file/inner.js index 30e742528..2dbe765ce 100644 --- a/www/file/inner.js +++ b/www/file/inner.js @@ -91,7 +91,12 @@ define([ var key = Nacl.util.decodeBase64(cryptKey); FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) { - if (e) { return void console.error(e); } + if (e) { + if (e === 'XHR_ERROR') { + return void UI.errorLoadingScreen(Messages.download_resourceNotAvailable); + } + return void console.error(e); + } var title = document.title = metadata.name; Title.updateTitle(title || Title.defaultTitle); toolbar.addElement(['pageTitle'], {pageTitle: title}); @@ -238,10 +243,9 @@ define([ } // we're in upload mode - if (!common.isLoggedIn()) { + UI.removeLoadingScreen(); return UI.alert(Messages.upload_mustLogin, function () { - UI.errorLoadingScreen(Messages.upload_mustLogin); common.setLoginRedirect(function () { common.gotoURL('/login/'); });