From 56fa7d6268f64e856eb25213410c3fbc5ed4e5ca Mon Sep 17 00:00:00 2001 From: pitchum Date: Sun, 25 Nov 2018 21:39:19 +0100 Subject: [PATCH] Force reloading VPN Settings page after validating form. --- sources/public/js/custom.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sources/public/js/custom.js b/sources/public/js/custom.js index f4e36e2..4e8a2d6 100644 --- a/sources/public/js/custom.js +++ b/sources/public/js/custom.js @@ -87,14 +87,12 @@ function ready() { headers: { 'X-Requested-With': 'jQuery', }, + timeout: 5000, dataType: "html", - success: function(data){ - document.body.innerHTML = new DOMParser().parseFromString(data, "text/html").body.innerHTML - ready() - }, - error: function() { - $('#save').prop('disabled', false); - $('#save-loading').hide(); + // success: function() {}, // XXX will never happen because the VPN connection will be restarted after the form is posted. + complete: function() { + console.log("Forcing page reload after a few seconds..."); + setTimeout(function() {document.location.reload();}, 45000) }, }); })