Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -2395,3 +2395,18 @@ tr:hover > td > .trash-button {
.searchbar input {
inline-size: 100%;
}

/* ----- Error ---------- */

#on-error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think we could use more obvious like containers-pref-error

margin-block: auto;
}

#on-error h2 {
font-weight: bold;
}

#on-error h2,
#on-error p {
text-align: center;
}
9 changes: 8 additions & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Loading