Skip to content

Commit

Permalink
🐛 Fix issue where overLink statuses wouldn't show if busy status beca…
Browse files Browse the repository at this point in the history
…me stuck
  • Loading branch information
kierandrewett committed Feb 15, 2024
1 parent a9be979 commit 4a7d37e
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions components/status/content/browser-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ class BrowserStatusPanel extends BrowserContextualMixin(MozHTMLElement) {
*/
getStatus() {
for (const statusType of this.STATUS_HIERARCHY) {
// Special case for busy statuses:
// Ensure the document is actually loading,
// otherwise we just skip it.
if (
statusType == "busy" &&
!this.hostContext.browser.webProgress.isLoadingDocument
) {
continue;
}

const statusValue =
this.status.getStatus(statusType) ||
this.status.getTabStatus(this.hostContext.tab, statusType);
Expand Down Expand Up @@ -86,13 +96,8 @@ class BrowserStatusPanel extends BrowserContextualMixin(MozHTMLElement) {
this.setAttribute("statustype", type);
}

const isActive =
type == "busy"
? this.hostContext.browser.webProgress.isLoadingDocument
: type;

this.removeAttribute("inactive-instant");
this.toggleAttribute("inactive", !isActive);
this.toggleAttribute("inactive", !type);
}

/**
Expand All @@ -113,11 +118,10 @@ class BrowserStatusPanel extends BrowserContextualMixin(MozHTMLElement) {

/**
* Fired when the active tab is changed
* @param {CustomEvent<{ tab: BrowserTab; }>} event
* @param {CustomEvent<BrowserTab>} event
*/
onTabChanged(event) {
const { tab } = event.detail;

const tab = event.detail;
if (tab !== this.hostContext.tab) return;

this._update();
Expand Down

0 comments on commit 4a7d37e

Please sign in to comment.