Skip to content

Commit

Permalink
fix: unintentional like button detection (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
j4k0xb committed Aug 8, 2022
1 parent 2a6d401 commit f64b178
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,15 @@ public static void onComponentCreated(Object conversionContext, AtomicReference<
if (!isEnabled) return;

try {
// Contains a pathBuilder string, used to distinguish from other litho components
if (!conversionContext.toString().contains("dislike_button")) return;
// Contains a pathBuilder string, used to distinguish from other litho components:
// video_action_bar.eml|27b56b54d5dcba20|video_action_bar_unwrapper.eml|c5a1d399b660e52e|CellType
// |ScrollableContainerType|ContainerType|ContainerType|dislike_button.eml|966ee2cd7db5e29f
// |video_actipathBuilder=video_action_bar.eml|27b56b54d5dcba20|video_action_bar_unwrapper.eml
// |c5a1d399b660e52e|CellType|ScrollableContainerType|ContainerType|ContainerType|dislike_button.eml
// |966ee2cd7db5e29f|video_action_toggle_button.eml|8fd9d44a8e3c9162|video_action_button.eml
// |9dd3b4b44979c3af|ContainerType|TextType|on_toggle_button.eml|8fd9d44a8e3c9162|video_action_button.eml
// |9dd3b4b44979c3af|ContainerType|TextType|
if (!conversionContext.toString().contains("|dislike_button.eml|")) return;

LogHelper.debug(ReturnYouTubeDislike.class, "dislike button was created");

Expand Down

0 comments on commit f64b178

Please sign in to comment.