From 6abb732be435fe63ea8dd2f9bc11880173f3532c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Jan 2023 11:14:40 +0400 Subject: [PATCH] fix:(youtube/return-youtube-dislike): always modify span content of the like button (#1448) --- .../returnyoutubedislike/patch/ReturnYouTubeDislikePatch.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/patch/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/patch/ReturnYouTubeDislikePatch.kt index de92cf14..78b8a4fa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/patch/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/patch/ReturnYouTubeDislikePatch.kt @@ -59,7 +59,9 @@ class ReturnYouTubeDislikePatch : BytecodePatch( val conversionContextParam = 5 val textRefParam = createComponentMethod.parameters.size - 2 - val insertIndex = scanResult.stringsScanResult!!.matches.first().index - 2 + // insert index must be 0, otherwise UI does not updated correctly in some situations + // such as switching from full screen or when using previous/next overlay buttons. + val insertIndex = 0 createComponentMethod.addInstructions( insertIndex,