mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
fix(YouTube - Change live ring click action): Clicking on the timestamp in the comments opens the channel
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
package app.revanced.extension.youtube.patches.general;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import app.revanced.extension.shared.utils.Logger;
|
||||
import app.revanced.extension.youtube.patches.general.requests.VideoDetailsRequest;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
@ -10,16 +14,16 @@ public final class OpenChannelOfLiveAvatarPatch {
|
||||
private static final boolean CHANGE_LIVE_RING_CLICK_ACTION =
|
||||
Settings.CHANGE_LIVE_RING_CLICK_ACTION.get();
|
||||
|
||||
private static volatile String videoId = "";
|
||||
private static volatile boolean isCommentsPanelOpen = false;
|
||||
private static final AtomicBoolean engagementPanelOpen = new AtomicBoolean(false);
|
||||
private static volatile boolean liveChannelAvatarClicked = false;
|
||||
private static volatile String videoId = "";
|
||||
|
||||
public static void commentsPanelClosed() {
|
||||
isCommentsPanelOpen = false;
|
||||
public static void showEngagementPanel(@Nullable Object object) {
|
||||
engagementPanelOpen.set(object != null);
|
||||
}
|
||||
|
||||
public static void commentsPanelOpen() {
|
||||
isCommentsPanelOpen = true;
|
||||
public static void hideEngagementPanel() {
|
||||
engagementPanelOpen.compareAndSet(true, false);
|
||||
}
|
||||
|
||||
public static void liveChannelAvatarClicked() {
|
||||
@ -34,13 +38,14 @@ public final class OpenChannelOfLiveAvatarPatch {
|
||||
if (!liveChannelAvatarClicked) {
|
||||
return false;
|
||||
}
|
||||
if (isCommentsPanelOpen) {
|
||||
if (engagementPanelOpen.get()) {
|
||||
return false;
|
||||
}
|
||||
VideoDetailsRequest request = VideoDetailsRequest.getRequestForVideoId(videoId);
|
||||
if (request != null) {
|
||||
String channelId = request.getInfo();
|
||||
if (channelId != null) {
|
||||
videoId = "";
|
||||
liveChannelAvatarClicked = false;
|
||||
VideoUtils.openChannel(channelId);
|
||||
return true;
|
||||
@ -60,7 +65,7 @@ public final class OpenChannelOfLiveAvatarPatch {
|
||||
if (!liveChannelAvatarClicked) {
|
||||
return;
|
||||
}
|
||||
if (isCommentsPanelOpen) {
|
||||
if (engagementPanelOpen.get()) {
|
||||
return;
|
||||
}
|
||||
if (newlyLoadedVideoId.isEmpty()) {
|
||||
|
Reference in New Issue
Block a user