Annullamento ottimizzazione hooks

This commit is contained in:
loviuz 2023-03-09 19:55:01 +01:00
parent 8d3bdcc59b
commit 684bb6f2f2
1 changed files with 23 additions and 25 deletions

View File

@ -56,35 +56,33 @@ function startHooks() {
* @param hook
*/
function startHook(hook, init) {
if (document.hasFocus()) {
$.ajax({
url: globals.rootdir + "/ajax.php",
type: "get",
data: {
op: "hook-lock",
id: hook.id,
},
success: function (data) {
var token = JSON.parse(data);
$.ajax({
url: globals.rootdir + "/ajax.php",
type: "get",
data: {
op: "hook-lock",
id: hook.id,
},
success: function (data) {
var token = JSON.parse(data);
if (init) {
hookCount("#hooks-counter");
if (init) {
hookCount("#hooks-counter");
updateHook(hook);
}
updateHook(hook);
}
if (token) {
executeHook(hook, token);
} else {
var timeout = 10;
if (token) {
executeHook(hook, token);
} else {
var timeout = 10;
setTimeout(function () {
startHook(hook);
}, timeout * 1000);
}
},
});
}
setTimeout(function () {
startHook(hook);
}, timeout * 1000);
}
},
});
}
/**