mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-02-01 06:37:32 +01:00
fix(YouTube - Announcements): Don't show error toast if there is no internet connection (#537)
This commit is contained in:
parent
fb56e9a362
commit
0ce92c284d
@ -32,6 +32,9 @@ public final class AnnouncementsPatch {
|
|||||||
public static void showAnnouncement(final Activity context) {
|
public static void showAnnouncement(final Activity context) {
|
||||||
if (!SettingsEnum.ANNOUNCEMENTS.getBoolean()) return;
|
if (!SettingsEnum.ANNOUNCEMENTS.getBoolean()) return;
|
||||||
|
|
||||||
|
// Check if there is internet connection
|
||||||
|
if (!ReVancedUtils.isNetworkConnected()) return;
|
||||||
|
|
||||||
ReVancedUtils.runOnBackgroundThread(() -> {
|
ReVancedUtils.runOnBackgroundThread(() -> {
|
||||||
try {
|
try {
|
||||||
HttpURLConnection connection = AnnouncementsRoutes.getAnnouncementsConnectionFromRoute(GET_LATEST_ANNOUNCEMENT, CONSUMER);
|
HttpURLConnection connection = AnnouncementsRoutes.getAnnouncementsConnectionFromRoute(GET_LATEST_ANNOUNCEMENT, CONSUMER);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user