From 0ce92c284d08a1c6bffba976e9cf208e82288ddf Mon Sep 17 00:00:00 2001 From: nullptr <107796137+johnconner122@users.noreply.github.com> Date: Mon, 11 Dec 2023 03:44:10 +0500 Subject: [PATCH] fix(YouTube - Announcements): Don't show error toast if there is no internet connection (#537) --- .../integrations/patches/announcements/AnnouncementsPatch.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/app/revanced/integrations/patches/announcements/AnnouncementsPatch.java b/app/src/main/java/app/revanced/integrations/patches/announcements/AnnouncementsPatch.java index e68d10c1..9961c4be 100644 --- a/app/src/main/java/app/revanced/integrations/patches/announcements/AnnouncementsPatch.java +++ b/app/src/main/java/app/revanced/integrations/patches/announcements/AnnouncementsPatch.java @@ -32,6 +32,9 @@ public final class AnnouncementsPatch { public static void showAnnouncement(final Activity context) { if (!SettingsEnum.ANNOUNCEMENTS.getBoolean()) return; + // Check if there is internet connection + if (!ReVancedUtils.isNetworkConnected()) return; + ReVancedUtils.runOnBackgroundThread(() -> { try { HttpURLConnection connection = AnnouncementsRoutes.getAnnouncementsConnectionFromRoute(GET_LATEST_ANNOUNCEMENT, CONSUMER);