Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Fix du bug du reload en boucle (nan ce n'est pas un prank)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnivtwelve committed Sep 28, 2022
1 parent db98818 commit 8bc598a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function loadPronoteData() {

// Si la requête fail, rafrachir le token
if (data.message !== undefined) {
location.reload(true);
tokenRefreshBkg();
}
else {
progressEnd();
Expand Down Expand Up @@ -659,6 +659,7 @@ tries = 0;
let triesReset;

function tokenRefreshBkg() {
console.log("Refreshing token in background...");
clearInterval(triesReset);

let toastText = "Reconnexion à Pronote en arrière-plan...";
Expand Down Expand Up @@ -694,6 +695,7 @@ function tokenRefreshBkg() {
}
}).showToast();
}
tokenRefreshBkg()
} else if (resp.token !== undefined) {
localStorage.setItem('authToken', resp.token);
token = resp.token;
Expand Down

0 comments on commit 8bc598a

Please sign in to comment.