From 98b375a0963b98a1e268c84bc675821eb13c5cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Astral=E2=9C=A8?= <90265231+astra1dev@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:52:15 +0200 Subject: [PATCH 1/2] add error callback when checking for updates --- app/src/main/java/com/nin0dev/vendroid/MainActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt index aa30dea..7dc7277 100644 --- a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt +++ b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt @@ -54,7 +54,11 @@ class MainActivity : Activity() { showDiscordToast("No updates available", "MESSAGE") } }, - { }) + { error -> + e("Network error during update check", error) + showDiscordToast("Failed to check for updates", "ERROR") + } + ) stringRequest.setShouldCache(false); queue.add(stringRequest) } From e9bfda34f3712a7e5e56650bb7c11fbef1d8a178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Astral=E2=9C=A8?= <90265231+astra1dev@users.noreply.github.com> Date: Sat, 17 Aug 2024 21:45:02 +0200 Subject: [PATCH 2/2] added debug check, using native toast instead of discord toast --- app/src/main/java/com/nin0dev/vendroid/MainActivity.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt index 7dc7277..7ef9160 100644 --- a/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt +++ b/app/src/main/java/com/nin0dev/vendroid/MainActivity.kt @@ -55,8 +55,10 @@ class MainActivity : Activity() { } }, { error -> - e("Network error during update check", error) - showDiscordToast("Failed to check for updates", "ERROR") + if (BuildConfig.DEBUG) { + e("Network error during update check", error) + } + Toast.makeText(this, "Failed to check for updates", Toast.LENGTH_SHORT).show() } ) stringRequest.setShouldCache(false);