minor fix

This commit is contained in:
ryanzhao 2021-05-28 15:14:05 +10:00
parent 4f7d26d86e
commit e8c52961aa
3 changed files with 8 additions and 3 deletions

View File

@ -20,6 +20,7 @@ import kotlinx.android.synthetic.main.activity_create_private_chat.viewPager
import kotlinx.android.synthetic.main.fragment_enter_public_key.*
import network.loki.messenger.R
import nl.komponents.kovenant.ui.failUi
import nl.komponents.kovenant.ui.successUi
import org.session.libsession.snode.SnodeAPI
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.conversation.ConversationActivity
@ -89,12 +90,12 @@ class CreatePrivateChatActivity : PassphraseRequiredActionBarActivity(), ScanQRC
} else {
// This could be an ONS name
showLoader()
SnodeAPI.getSessionIDFor(onsNameOrPublicKey).success { hexEncodedPublicKey ->
SnodeAPI.getSessionIDFor(onsNameOrPublicKey).successUi { hexEncodedPublicKey ->
hideLoader()
this.createPrivateChat(hexEncodedPublicKey)
}.failUi { exception ->
hideLoader()
var message = "Please check the Session ID or ONS name and try again."
var message = resources.getString(R.string.fragment_enter_public_key_error_message)
exception.localizedMessage?.let {
message = it
}

View File

@ -721,6 +721,7 @@
<string name="fragment_enter_public_key_edit_text_hint">Enter Session ID or ONS name</string>
<string name="fragment_enter_public_key_explanation">Users can share their Session ID by going into their account settings and tapping "Share Session ID", or by sharing their QR code.</string>
<string name="fragment_enter_public_key_error_message">Please check the Session ID or ONS name and try again.</string>
<string name="fragment_scan_qr_code_camera_access_explanation">Session needs camera access to scan QR codes</string>
<string name="fragment_scan_qr_code_grant_camera_access_button_title">Grant Camera Access</string>

View File

@ -183,8 +183,11 @@ object SnodeAPI {
)
val promises = (1..validationCount).map {
getRandomSnode().bind { snode ->
retryIfNeeded(maxRetryCount) {
invoke(Snode.Method.OxenDaemonRPCCall, snode, null, parameters)
}
}
}
all(promises).success { results ->
val sessionIDs = mutableListOf<String>()