Skip to content

Commit

Permalink
use a separate string when showing errors of background app update check
Browse files Browse the repository at this point in the history
  • Loading branch information
muhomorr authored and thestinger committed Jul 18, 2024
1 parent 1367705 commit 5f306e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fun showAllUpToDateNotification() {
fun showUpdateCheckFailedNotification(repoUpdateError: RepoUpdateError) {
Notifications.builder(Notifications.CH_BACKGROUND_UPDATE_CHECK_FAILED).run {
setSmallIcon(R.drawable.ic_error)
setContentTitle(R.string.unable_to_fetch_app_list)
setContentTitle(R.string.app_update_check_failed)
setContentIntent(ErrorDialog.createPendingIntent(repoUpdateError))
show(Notifications.ID_AUTO_UPDATE_JOB_STATUS)
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/app/grapheneos/apps/core/Errors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ private fun networkErrorResStringOrZero(e: Throwable) = when (e) {

@Parcelize
class RepoUpdateError(val throwable: Throwable, val wasUpdateManuallyRequested: Boolean) : ErrorTemplate() {
override fun titleResource() = R.string.unable_to_fetch_app_list
override fun titleResource() = if (wasUpdateManuallyRequested)
R.string.unable_to_fetch_app_list else R.string.app_update_check_failed

fun isNotable() = when (throwable) {
is ConnectException,
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
<string name="notif_download_failed">Download failed</string>

<string name="unable_to_fetch_app_list">Unable to fetch the list of apps</string>
<string name="app_update_check_failed">App update check failed</string>

<string name="main_screen_unable_to_fetch_app_list_initial">Unable to fetch the list of apps, swipe down to try again.</string>

<string name="uninstall_failed">Uninstall failed</string>
Expand Down

0 comments on commit 5f306e5

Please sign in to comment.