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
Branches
Tags
No related merge requests found
......@@ -54,21 +54,14 @@ $(function () {
}
function setSessionTimer(time) {
timer = setTimeout(function () {
$.ajax({
type: "POST",
url: URLdir + "handler/Session/getSessionTime",
success: function (data) {
data = $.parseJSON(data);
wait = parseInt(data, 10);
if (wait <= 10) {
closeSession();
} else {
setSessionTimer(wait - 10);
}
}
});
}, 1000 * time);
let updateTime = () =>
$.post(URLdir + 'handler/Session/getSessionTime', {})
.done(function (data) {
let wait = parseInt(data, 10);
wait <= 10 ? closeSession() : setSessionTimer(wait - 10);
}, 'json');
setTimeout(updateTime, 1000 * time);
}
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