Add for-you link resolution in app chrome

This commit is contained in:
thePR0M3TH3AN committed 2026-01-18 20:10:33 -05:00
1 parent 5cdffbf019
commit d7116b08a6
2 files changed
+27

No files matched your search

+26
View File
@@ -3928,6 +3928,11 @@ class Application {
if (subscriptionsLink) {
subscriptionsLink.classList.remove("hidden");
}
const forYouLink = this.resolveForYouLink();
if (forYouLink) {
forYouLink.classList.remove("hidden");
}
}
applyLoggedOutUiState() {
@@ -3962,6 +3967,11 @@ class Application {
if (subscriptionsLink) {
subscriptionsLink.classList.add("hidden");
}
const forYouLink = this.resolveForYouLink();
if (forYouLink) {
forYouLink.classList.add("hidden");
}
}
syncAuthUiState() {
@@ -4018,9 +4028,25 @@ class Application {
return null;
}
resolveForYouLink() {
if (this.forYouLink instanceof HTMLElement && this.forYouLink.isConnected) {
return this.forYouLink;
}
const linkCandidate = document.getElementById("forYouLink");
if (linkCandidate instanceof HTMLElement) {
this.forYouLink = linkCandidate;
return this.forYouLink;
}
this.forYouLink = null;
return null;
}
hydrateSidebarNavigation() {
const chromeElements = this.refreshChromeElements();
this.resolveSubscriptionsLink();
this.resolveForYouLink();
if (this.appChromeController) {
if (typeof this.appChromeController.setElements === "function") {
+1
View File
@@ -628,6 +628,7 @@ export default class ApplicationBootstrap {
app.tagPreferencePopovers = new Map();
app.subscriptionsLink = null;
app.forYouLink = null;
app.notificationPortal = doc?.getElementById("notificationPortal") || null;
app.errorContainer = doc?.getElementById("errorContainer") || null;