fix(YouTube - Hide layout components): Do not hide playlist sort button if 'Hide AI comments summary' is on

This commit is contained in:
LisoUseInAIKyrios
2025-07-09 18:33:24 +04:00
parent 1c0a0eb4b5
commit cc4aef89d3

View File

@@ -3,6 +3,7 @@ package app.revanced.extension.youtube.patches.components;
import androidx.annotation.Nullable;
import app.revanced.extension.youtube.settings.Settings;
import app.revanced.extension.youtube.shared.PlayerType;
@SuppressWarnings("unused")
final class CommentsFilter extends Filter {
@@ -89,7 +90,9 @@ final class CommentsFilter extends Filter {
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
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;