From 72e010302121d32b54ba41deef736810cb7db1b4 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sun, 30 Jan 2022 13:04:07 +0300 Subject: [PATCH] Timezone: Fix funny case when page is always reloading in some places --- Web/static/js/timezone.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Web/static/js/timezone.js b/Web/static/js/timezone.js index a85472fd..fc4f8c55 100755 --- a/Web/static/js/timezone.js +++ b/Web/static/js/timezone.js @@ -3,5 +3,9 @@ xhr = new XMLHttpRequest(); xhr.open("POST", "/iapi/timezone", true); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); -xhr.onload = () => {window.location.reload()}; +xhr.onload = () => { + if(JSON.parse(response.originalTarget.responseText).response == 1) { + window.location.reload(); + } +}; xhr.send('timezone=' + new Date().getTimezoneOffset());