mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
SES-2229 Fix NewMessage ONS timeout error message for real
This commit is contained in:
parent
f2e72d794b
commit
1f50a702bc
@ -20,6 +20,7 @@ import org.session.libsession.snode.SnodeAPI
|
||||
import org.session.libsignal.utilities.PublicKeyValidation
|
||||
import org.session.libsignal.utilities.timeout
|
||||
import org.thoughtcrime.securesms.ui.GetString
|
||||
import java.util.concurrent.TimeoutException
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.cancellation.CancellationException
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
@ -100,8 +101,8 @@ internal class NewMessageViewModel @Inject constructor(
|
||||
|
||||
private fun Exception.toMessage() = when (this) {
|
||||
is SnodeAPI.Error.Generic -> application.getString(R.string.onsErrorNotRecognized)
|
||||
is TimeoutCancellationException -> application.getString(R.string.onsErrorUnableToSearch)
|
||||
else -> localizedMessage ?: application.getString(R.string.fragment_enter_public_key_error_message)
|
||||
is TimeoutException -> application.getString(R.string.onsErrorUnableToSearch)
|
||||
else -> application.getString(R.string.fragment_enter_public_key_error_message)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user