Skip to content
Snippets Groups Projects
Commit ad472642 authored by xamgore's avatar xamgore
Browse files

Fix errors & reformat code in profile.js

parent f25a88af
No related merge requests found
...@@ -54,21 +54,14 @@ $(function () { ...@@ -54,21 +54,14 @@ $(function () {
} }
function setSessionTimer(time) { function setSessionTimer(time) {
timer = setTimeout(function () { let updateTime = () =>
$.ajax({ $.post(URLdir + 'handler/Session/getSessionTime', {})
type: "POST", .done(function (data) {
url: URLdir + "handler/Session/getSessionTime", let wait = parseInt(data, 10);
success: function (data) { wait <= 10 ? closeSession() : setSessionTimer(wait - 10);
data = $.parseJSON(data); }, 'json');
wait = parseInt(data, 10);
if (wait <= 10) { setTimeout(updateTime, 1000 * time);
closeSession();
} else {
setSessionTimer(wait - 10);
}
}
});
}, 1000 * time);
} }
setSessionTimer(1); setSessionTimer(1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment