mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-20 01:23:57 +00:00
fix(YouTube - Hide layout components): Do not hide playlist sort button if 'Hide AI comments summary' is on
This commit is contained in:
@@ -3,6 +3,7 @@ package app.revanced.extension.youtube.patches.components;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
|
import app.revanced.extension.youtube.shared.PlayerType;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
final class CommentsFilter extends Filter {
|
final class CommentsFilter extends Filter {
|
||||||
@@ -89,7 +90,9 @@ final class CommentsFilter extends Filter {
|
|||||||
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
|
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
|
||||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||||
if (matchedGroup == chipBar) {
|
if (matchedGroup == chipBar) {
|
||||||
return aiCommentsSummary.check(protobufBufferArray).isFiltered();
|
// Playlist sort button uses same components and must only filter if the player is opened.
|
||||||
|
return PlayerType.getCurrent().isMaximizedOrFullscreen()
|
||||||
|
&& aiCommentsSummary.check(protobufBufferArray).isFiltered();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user