ui: Replace ErrorMessages getter with indexing operator
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
@@ -34,7 +34,7 @@ class ModuleDownloaderPreference(context: Context, attrs: AttributeSet?) : Prefe
|
||||
when {
|
||||
throwable != null -> {
|
||||
setState(State.FAILURE)
|
||||
Toast.makeText(context, ErrorMessages.get(throwable), Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(context, ErrorMessages[throwable], Toast.LENGTH_LONG).show()
|
||||
}
|
||||
result == OsConstants.ENOENT -> setState(State.NOTFOUND)
|
||||
result == OsConstants.EXIT_SUCCESS -> {
|
||||
|
||||
@@ -63,7 +63,7 @@ class ZipExporterPreference(context: Context, attrs: AttributeSet?) : Preference
|
||||
|
||||
private fun exportZipComplete(filePath: String?, throwable: Throwable?) {
|
||||
if (throwable != null) {
|
||||
val error = ErrorMessages.get(throwable)
|
||||
val error = ErrorMessages[throwable]
|
||||
val message = context.getString(R.string.zip_export_error, error)
|
||||
Log.e(TAG, message, throwable)
|
||||
Snackbar.make(
|
||||
|
||||
Reference in New Issue
Block a user