Merge pull request #959 from PR0M3TH3AN/codex/fix-sidebar-subscriptions-button-display

Ensure subscriptions link hydrates after sidebar load
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-26 22:14:21 -04:00
commit c04643b3f8
2 files changed
+34 -4

No files matched your search

+26 -4
View File
@@ -5373,8 +5373,9 @@ class Application {
this.profileButton.removeAttribute("hidden");
}
if (this.subscriptionsLink) {
this.subscriptionsLink.classList.remove("hidden");
const subscriptionsLink = this.resolveSubscriptionsLink();
if (subscriptionsLink) {
subscriptionsLink.classList.remove("hidden");
}
}
@@ -5406,8 +5407,9 @@ class Application {
this.profileButton.setAttribute("hidden", "");
}
if (this.subscriptionsLink) {
this.subscriptionsLink.classList.add("hidden");
const subscriptionsLink = this.resolveSubscriptionsLink();
if (subscriptionsLink) {
subscriptionsLink.classList.add("hidden");
}
}
@@ -5419,6 +5421,26 @@ class Application {
}
}
resolveSubscriptionsLink() {
if (this.subscriptionsLink instanceof HTMLElement) {
return this.subscriptionsLink;
}
const linkCandidate = document.getElementById("subscriptionsLink");
if (linkCandidate instanceof HTMLElement) {
this.subscriptionsLink = linkCandidate;
return this.subscriptionsLink;
}
this.subscriptionsLink = null;
return null;
}
hydrateSidebarNavigation() {
this.resolveSubscriptionsLink();
this.syncAuthUiState();
}
maybeShowExperimentalLoginWarning(provider) {
const normalizedProvider =
typeof provider === "string" ? provider.trim().toLowerCase() : "";
+8
View File
@@ -620,6 +620,14 @@ async function bootstrapInterface() {
await loadSidebar("components/sidebar.html", "sidebarContainer");
devLogger.log("Sidebar loaded.");
if (application && typeof application.hydrateSidebarNavigation === "function") {
try {
application.hydrateSidebarNavigation();
} catch (error) {
devLogger.warn("[Interface] Failed to hydrate sidebar navigation:", error);
}
}
bindOptionalExternalLink({
selector: "[data-blog-link]",
url: BLOG_URL,