Skip to main content
Sign in
Snippets Groups Projects
Verified Commit 1343ed70 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 40597: Implement TorSettings module

Bug 41114: Refactor TorConnect.

When simulating censorship, do not trigger an additional change of state
if one is already happening.
parent becb5e4b
No related branches found
No related tags found
1 merge request!938Bug 41114: Fix no-async-promise-executor on TorConnect and general refactor
......@@ -383,6 +383,10 @@ class BootstrappingState extends StateCallback {
}
await debugSleep(1500);
if (this.transitioning) {
// Already left this state.
return true;
}
TorConnect._hasBootstrapEverFailed = true;
if (censorshipLevel === 2) {
const codes = Object.keys(TorConnect._countryNames);
......@@ -454,11 +458,13 @@ class AutoBootstrappingState extends StateCallback {
// location specific settings.
if (censorshipLevel === 3) {
await debugSleep(2500);
if (!this.transitioning) {
this.changeState(
TorConnectState.Error,
"Error: censorship simulation",
""
);
}
return true;
}
......@@ -466,11 +472,13 @@ class AutoBootstrappingState extends StateCallback {
// manually selecting a country.
if (censorshipLevel === 2 && !countryCode) {
await debugSleep(2500);
if (!this.transitioning) {
this.changeState(
TorConnectState.Error,
"Error: Severe Censorship simulation",
""
);
}
return true;
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment