Show error message and troubleshooting steps on contextual identitier error
This commit is contained in:
parent
59e951e5d2
commit
3434b62674
3 changed files with 452 additions and 423 deletions
|
@ -2395,3 +2395,18 @@ tr:hover > td > .trash-button {
|
|||
.searchbar input {
|
||||
inline-size: 100%;
|
||||
}
|
||||
|
||||
/* ----- Error ---------- */
|
||||
|
||||
#on-error {
|
||||
margin-block: auto;
|
||||
}
|
||||
|
||||
#on-error h2 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#on-error h2,
|
||||
#on-error p {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -74,12 +74,19 @@ const Logic = {
|
|||
// Retrieve the list of identities.
|
||||
const identitiesPromise = this.refreshIdentities();
|
||||
|
||||
const errorBlock = document.getElementById("on-error");
|
||||
const successBlock = document.getElementById("on-success");
|
||||
try {
|
||||
await identitiesPromise;
|
||||
} catch (e) {
|
||||
throw new Error("Failed to retrieve the identities or variation. We cannot continue. ", e.message);
|
||||
errorBlock.style.display = "block";
|
||||
successBlock.style.display = "none";
|
||||
return;
|
||||
}
|
||||
|
||||
errorBlock.style.display = "none";
|
||||
successBlock.style.display = "block";
|
||||
|
||||
// Routing to the correct panel.
|
||||
// If localStorage is disabled, we don't show the onboarding.
|
||||
const onboardingData = await browser.storage.local.get([ONBOARDING_STORAGE_KEY]);
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
<link rel="stylesheet" href="./css/popup.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="on-error">
|
||||
<h2 data-i18n-message-id="contextual-identities-error-title"></h2>
|
||||
<p data-i18n-message-id="contextual-identities-error-description"></p>
|
||||
</div>
|
||||
|
||||
<div id="on-success">
|
||||
<div class="hide panel onboarding onboarding-panel-1">
|
||||
<img class="onboarding-img" alt="" src="/img/onboarding-1.png" />
|
||||
<h3 class="onboarding-title" data-i18n-message-id="onboarding-1-header"></h3>
|
||||
|
@ -464,6 +470,7 @@
|
|||
<button id="enable-proxy-permissions" class="primary-cta" data-tab-group="proxy-disabled" data-i18n-message-id="enable"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/utils.js"></script>
|
||||
<script src="js/popup.js"></script>
|
||||
<script src="js/mozillaVpn.js"></script>
|
||||
|
|
Loading…
Add table
Reference in a new issue