Skip to content

Commit

Permalink
fix(skymp5-client): increase delays in AuthService (#2070)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Jul 17, 2024
1 parent 3875899 commit b9cf38c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skymp5-client/src/services/services/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export class AuthService extends ClientListener {
if (error) {
browserState.failCount = 0;
browserState.comment = (error);
timersService.setTimeout(() => this.checkLoginState(), 1.5 + Math.random() * 2);
timersService.setTimeout(() => this.checkLoginState(), Math.floor((1.5 + Math.random() * 2) * 1000));
this.refreshWidgets();
return;
}
Expand All @@ -298,7 +298,7 @@ export class AuthService extends ClientListener {
case 401: // Unauthorized
browserState.failCount = 0;
browserState.comment = '';//(`Still waiting...`);
timersService.setTimeout(() => this.checkLoginState(), 1.5 + Math.random() * 2);
timersService.setTimeout(() => this.checkLoginState(), Math.floor((1.5 + Math.random() * 2) * 1000));
break;
case 403: // Forbidden
case 404: // Not found
Expand All @@ -308,7 +308,7 @@ export class AuthService extends ClientListener {
default:
++browserState.failCount;
browserState.comment = `Server returned ${response.status.toString() || "???"} "${response.body || response.error}"`;
timersService.setTimeout(() => this.checkLoginState(), 1.5 + Math.random() * 2);
timersService.setTimeout(() => this.checkLoginState(), Math.floor((1.5 + Math.random() * 2) * 1000));
}
});
};
Expand Down

0 comments on commit b9cf38c

Please sign in to comment.