Skip to content
Snippets Groups Projects
Verified Commit 02df5609 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

Various fixes to address tor-browser!968.
parent 01d7d557
Branches
Tags
1 merge request!968Draft: Bug 42479: Improve TorConnect error handling
......@@ -95,9 +95,9 @@ export class TorConnectParent extends JSWindowActorParent {
// noop
break;
}
case TorConnectTopics.BootstrapError: {
case TorConnectTopics.Error: {
self.state.ErrorCode = obj.code;
self.state.ErrorDetails = obj.details;
self.state.ErrorDetails = obj;
self.state.InternetStatus = TorConnect.internetStatus;
self.state.DetectedLocation = TorConnect.detectedLocation;
self.state.ShowViewLog = true;
......
......
......@@ -361,12 +361,15 @@ class AboutTorConnect {
}
getMaybeLocalizedError(state) {
if (!state?.ErrorCode) {
return "";
}
switch (state.ErrorCode) {
case "Offline":
return TorStrings.torConnect.offline;
case "BootstrapError": {
const details = state.ErrorDetails?.details;
if (!details || !details.phase || !details.reason) {
const details = state.ErrorDetails?.cause;
if (!details?.phase || !details?.reason) {
return TorStrings.torConnect.torBootstrapFailed;
}
let status = this.getLocalizedStatus(details.phase);
......@@ -632,7 +635,7 @@ class AboutTorConnect {
showFinalError(state) {
this.setTitle(TorStrings.torConnect.finalError, "final");
this.setLongText(TorStrings.torConnect.finalErrorDescription);
this.setProgress(state ? this.getMaybeLocalizedError(state) : "", false);
this.setProgress(this.getMaybeLocalizedError(state), false);
this.setBreadcrumbsStatus(
BreadcrumbStatus.Default,
BreadcrumbStatus.Default,
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment