Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Fixed an issue where I was trying to reference a variable before assi…
Browse files Browse the repository at this point in the history
…gning it

Fixed an issue where Lives and Premieres weren't being hidden when viewing the Subscriptions page in list view
  • Loading branch information
probablyraging committed Jun 10, 2023
1 parent 4a7d7d3 commit 4dfa8b2
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/constants/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ function hideLiveVideosHomeFeed(isMobile) {

elements.forEach(el => {
if (el.innerText.replace(/\s/g, '').replace(/\n/g, '') === 'LIVE') {
el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
if (grandParent.classList.contains('ytd-rich-grid-row') || grandParent.classList.contains('ytd-rich-item-renderer')) {
grandParent.style.display = 'none';
}
}
});
}
Expand All @@ -199,7 +202,10 @@ function hidePremiereVideosHomeFeed(isMobile) {

elements.forEach(el => {
if (el.innerText.replace(/\s/g, '').replace(/\n/g, '') === 'PREMIERE') {
el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
if (grandParent.classList.contains('ytd-rich-grid-row') || grandParent.classList.contains('ytd-rich-item-renderer')) {
grandParent.style.display = 'none';
}
}
});
}
Expand Down Expand Up @@ -264,10 +270,14 @@ function hideLiveVideosSubscriptionFeed(isMobile) {

elements.forEach(el => {
if (el.innerText.replace(/\s/g, '').replace(/\n/g, '') === 'LIVE') {
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
const grandParentList = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
if (grandParent.classList.contains('ytd-rich-grid-row') || grandParent.classList.contains('ytd-rich-item-renderer')) {
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
grandParent.style.display = 'none';
}
if (grandParentList.classList.contains('ytd-shelf-renderer')) {
grandParentList.style.display = 'none';
}
}
});
}
Expand All @@ -282,10 +292,14 @@ function hidePremiereVideosSubscriptionFeed(isMobile) {

elements.forEach(el => {
if (el.innerText.replace(/\s/g, '').replace(/\n/g, '') === 'PREMIERE') {
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
const grandParentList = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
if (grandParent.classList.contains('ytd-rich-grid-row') || grandParent.classList.contains('ytd-rich-item-renderer')) {
const grandParent = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
grandParent.style.display = 'none';
}
if (grandParentList.classList.contains('ytd-shelf-renderer')) {
grandParentList.style.display = 'none';
}
}
});
}
Expand Down

0 comments on commit 4dfa8b2

Please sign in to comment.