Timezone: Fix funny case when page is always reloading in some places

This commit is contained in:
veselcraft 2022-01-30 13:04:07 +03:00
parent bf19fb2ab7
commit 72e0103021
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -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());