From fb51189d15563f6af5835fbde199324557a144d2 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 13 Jan 2016 11:47:46 +0530 Subject: [PATCH] reload if backend was already done --- static/js/oml.update.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/static/js/oml.update.js b/static/js/oml.update.js index da980b9..b20a7dd 100644 --- a/static/js/oml.update.js +++ b/static/js/oml.update.js @@ -89,7 +89,11 @@ color: '#999999' }).appendTo(Ox.$('#loadingScreen')); oml.ui.status.html('Updating Open Media Library...'); - oml.reload = true; + oml.down = setTimeout(function() { + if (oml.socket.readyState != oml.socket.OPEN && Ox.isUndefined(oml.reload)) { + reload(); + } + }, 5000); }, updatestatus: function(data) { oml.ui.status.html(data.status); @@ -98,9 +102,8 @@ close: function(data) { }, open: function(data) { - Ox.print('socket open'); if (oml.reload) { - document.location.href = document.location.protocol + '//' + document.location.host; + reload(); } } }); @@ -146,6 +149,10 @@ document.body && window.onload(); } + function reload() { + document.location.href = document.location.protocol + '//' + document.location.host; + } + function removeScreen() { var $loadingScreen = $('#loadingScreen'); $loadingScreen.animate({