Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesSmartCell committed Oct 8, 2023
1 parent 2eec348 commit ea95f8f
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions app/src/main/java/com/alphawallet/app/viewmodel/HomeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,19 @@ public void tryToShowWhatsNewDialog(Context context)
doShowWhatsNewDialog(context, releases);
preferenceRepository.setLastVersionCode(versionCode);
}
}, e -> {
Timber.e(e);
}).isDisposed();
}
}
catch (PackageManager.NameNotFoundException e)
{
Timber.e(e);
}
catch (Exception e)
{
Timber.e(e);
}

}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit ea95f8f

Please sign in to comment.