Merge pull request #310 from mozilla/addresses159
if the download card is pressed, the expired card shows up properly
This commit is contained in:
commit
109617d817
2 changed files with 10 additions and 7 deletions
|
@ -144,12 +144,15 @@ $(document).ready(function() {
|
|||
cd6: err
|
||||
});
|
||||
|
||||
document.l10n.formatValue('expiredPageHeader').then(translated => {
|
||||
$('.title').text(translated);
|
||||
});
|
||||
$('#download-btn').attr('hidden', true);
|
||||
$('#expired-img').removeAttr('hidden');
|
||||
console.log('The file has expired, or has already been deleted.');
|
||||
if (err.message === 'notfound') {
|
||||
location.reload();
|
||||
} else {
|
||||
document.l10n.formatValue('errorPageHeader').then(translated => {
|
||||
$('.title').text(translated);
|
||||
});
|
||||
$('#download-btn').attr('hidden', true);
|
||||
$('#expired-img').removeAttr('hidden');
|
||||
}
|
||||
return;
|
||||
})
|
||||
.then(([decrypted, fname]) => {
|
||||
|
|
|
@ -20,7 +20,7 @@ class FileReceiver extends EventEmitter {
|
|||
xhr.onload = function(event) {
|
||||
if (xhr.status === 404) {
|
||||
reject(
|
||||
new Error('The file has expired, or has already been deleted.')
|
||||
new Error('notfound')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue