mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Add for-you link resolution in app chrome
This commit is contained in:
1 parent
5cdffbf019
commit
d7116b08a6
2 files changed
+27
No files matched your search
@@ -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") {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user