File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
app/src/main/java/to/bitkit/utils/timedsheets/sheets Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -18,21 +18,19 @@ class AppUpdateTimedSheet @Inject constructor(
1818 override val priority = 5
1919
2020 override suspend fun shouldShow (): Boolean = withContext(bgDispatcher) {
21- try {
21+ return @withContext runCatching {
2222 val androidReleaseInfo = appUpdaterService.getReleaseInfo().platforms.android
2323 val currentBuildNumber = BuildConfig .VERSION_CODE
2424
2525 if (androidReleaseInfo.buildNumber <= currentBuildNumber) return @withContext false
2626
2727 if (androidReleaseInfo.isCritical) {
28- return @withContext false
28+ return @runCatching false
2929 }
30-
31- return @withContext true
32- } catch (e: Exception ) {
30+ return @runCatching true
31+ }.onFailure { e ->
3332 Logger .warn(" Failure fetching new releases" , e = e, context = TAG )
34- return @withContext false
35- }
33+ }.getOrDefault(false )
3634 }
3735
3836 override suspend fun onShown () {
You can’t perform that action at this time.
0 commit comments