From ea95f8faae628058dae0860bd411e5351013b3ea Mon Sep 17 00:00:00 2001 From: James Brown Date: Sun, 8 Oct 2023 22:32:55 +1100 Subject: [PATCH] Update --- .../app/viewmodel/HomeViewModel.java | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/alphawallet/app/viewmodel/HomeViewModel.java b/app/src/main/java/com/alphawallet/app/viewmodel/HomeViewModel.java index a5d46bad9e..edb1c02b19 100644 --- a/app/src/main/java/com/alphawallet/app/viewmodel/HomeViewModel.java +++ b/app/src/main/java/com/alphawallet/app/viewmodel/HomeViewModel.java @@ -661,6 +661,8 @@ public void tryToShowWhatsNewDialog(Context context) doShowWhatsNewDialog(context, releases); preferenceRepository.setLastVersionCode(versionCode); } + }, e -> { + Timber.e(e); }).isDisposed(); } } @@ -668,6 +670,10 @@ public void tryToShowWhatsNewDialog(Context context) { Timber.e(e); } + catch (Exception e) + { + Timber.e(e); + } } @@ -848,25 +854,32 @@ public void checkLatestGithubRelease() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe((releases) -> { - if (!releases.isEmpty()) + try { - GitHubRelease latestRelease = releases.get(0); - if (latestRelease != null) + if (!releases.isEmpty()) { - String latestTag = latestRelease.getTagName(); - if (latestRelease.getTagName().charAt(0) == 'v') + GitHubRelease latestRelease = releases.get(0); + if (latestRelease != null) { - latestTag = latestTag.substring(1); - } - Version latest = new Version(latestTag); - Version installed = new Version(BuildConfig.VERSION_NAME); - - if (latest.compareTo(installed) > 0) - { - updateAvailable.postValue(latest.get()); + String latestTag = latestRelease.getTagName(); + if (latestRelease.getTagName().charAt(0) == 'v') + { + latestTag = latestTag.substring(1); + } + Version latest = new Version(latestTag); + Version installed = new Version(BuildConfig.VERSION_NAME); + + if (latest.compareTo(installed) > 0) + { + updateAvailable.postValue(latest.get()); + } } } } + catch (Exception e) + { + e.printStackTrace(); + } }, Timber::e ).isDisposed(); }