diff --git a/couchpotato/core/_base/updater/static/updater.js b/couchpotato/core/_base/updater/static/updater.js index 48d077c1..202540d3 100644 --- a/couchpotato/core/_base/updater/static/updater.js +++ b/couchpotato/core/_base/updater/static/updater.js @@ -76,32 +76,10 @@ var UpdaterBase = new Class({ Api.request('updater.update', { 'onComplete': function(json){ - if(json.success){ - App.restart(); - - $(document.body).set('spin', { - 'message': 'Updating' - }); - $(document.body).spin(); - - var checks = 0; - var interval = 0; - interval = setInterval(function(){ - Api.request('', { - 'onSuccess': function(){ - if(checks > 2){ - clearInterval(interval); - $(document.body).unspin(); - self.info(); - } - } - }); - checks++; - }, 500) - + App.restart('Please wait while CouchPotato is being updated with more awesome stuff.', 'Updating'); + App.checkAvailable.delay(500, App); } - } }); } diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index b615f341..edafdf4c 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -161,10 +161,10 @@ var CouchPotato = new Class({ self.checkAvailable(1000); }, - restart: function(){ + restart: function(message, title){ var self = this; - self.blockPage('Restarting... please wait. If this takes to long, something must have gone wrong.'); + self.blockPage(message || 'Restarting... please wait. If this takes to long, something must have gone wrong.', title); Api.request('app.restart'); self.checkAvailable(1000); },