From 89ba88eb96d38aedcb7c985ae1f12f084c005ba4 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Thu, 9 Feb 2017 18:19:57 +0100 Subject: [PATCH] Fix reload of homepage after restart in some browsers --- gui/slick/js/restart.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/slick/js/restart.js b/gui/slick/js/restart.js index 9f579ae3..32f10bbc 100644 --- a/gui/slick/js/restart.js +++ b/gui/slick/js/restart.js @@ -15,7 +15,10 @@ $.SickGear.numRestartWaits = 0; function is_alive() { timeoutId = 0; - $.get(isAliveUrl, function(data) { + $.ajax({url: isAliveUrl, + type: 'GET', + dataType: 'jsonp', + success: function(data) { var resp = data.msg.toString(); if ('nope' == resp) { @@ -37,7 +40,11 @@ function is_alive() { $('#refresh_message').removeClass(); window.location = baseUrl + '/home/'; } - }, 'jsonp'); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + setTimeout(is_alive, 100); + } + }); } $(document).ready(function() {