From 8db367c74353f2b86d0effeebfe84c7cc4f512ab Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 30 Dec 2020 14:30:39 +0000 Subject: remove fallback code - it will not be required if compression is dismissed --- view/js/mod_cloud.js | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'view') diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index aeaac8c69..8fb66c5aa 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -70,33 +70,18 @@ $(document).ready(function () { $('body').css('cursor', 'wait'); $.jGrowl('Please stand by while your download is being prepared...', { sticky: false, theme: 'info', life: 10000 }); - var download_token = makeid(32); - let data = [ {name: 'attach_path', value: window.location.pathname}, - {name: 'download_token', value: download_token}, {name: 'channel_id', value: channelId}, {name: 'attach_ids[]', value: id} ] $.post('attach', data, function (data) { - if (data.success) { - $('body').css('cursor', 'auto'); - window.location.href = '/attach/download?token=' + data.token + '&download_token=' + download_token; - clearInterval(fallback); - } - }); - - // fallback if server timed out - - var fallback = setInterval(function(){ $.get('/attach/check?download_token=' + download_token, function(data){ if (data.success) { $('body').css('cursor', 'auto'); window.location.href = '/attach/download?token=' + data.token; - clearInterval(fallback); } - - }); }, 30000); + }); }); @@ -313,33 +298,17 @@ $(document).ready(function () { $('body').css('cursor', 'wait'); $.jGrowl('Please stand by while your download is being prepared...', { sticky: false, theme: 'info', life: 10000 }); - var download_token = makeid(32); - post_data.push( {name: 'attach_path', value: window.location.pathname}, - {name: 'download_token', value: download_token}, - {name: 'channel_id', value: channelId}, + {name: 'channel_id', value: channelId} ); $.post('attach', post_data, function (data) { - if (data.success) { - $('body').css('cursor', 'auto'); - window.location.href = '/attach/download?token=' + data.token + '&download_token=' + download_token; - clearInterval(fallback); - } - }); - - // fallback if server timed out - - var fallback = setInterval(function(){ $.get('/attach/check?download_token=' + download_token, function(data){ if (data.success) { $('body').css('cursor', 'auto'); window.location.href = '/attach/download?token=' + data.token; - clearInterval(fallback); } - - }); }, 30000); - + }); }); -- cgit v1.2.3