mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Fix QR code handler not running on UI thread
This commit is contained in:
parent
983b137cd6
commit
449a53ea32
@ -797,6 +797,7 @@ public class ConversationItem extends LinearLayout
|
||||
}
|
||||
|
||||
private void setContactPhoto(@NonNull Recipient recipient) {
|
||||
if (messageRecord == null) return;
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)bodyBubble.getLayoutParams();
|
||||
int groupThreadMargin = (int)(getResources().getDimension(R.dimen.large_spacing) + getResources().getDimension(R.dimen.small_profile_picture_size));
|
||||
int defaultMargin = 0;
|
||||
|
@ -62,22 +62,20 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
||||
}
|
||||
|
||||
fun joinPublicChatIfPossible(url: String) {
|
||||
runOnUiThread {
|
||||
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
||||
Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
||||
return@runOnUiThread
|
||||
}
|
||||
showLoader()
|
||||
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
||||
Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
showLoader()
|
||||
|
||||
val channel: Long = 1
|
||||
OpenGroupUtilities.addGroup(this, url, channel).success {
|
||||
MessageSender.syncAllOpenGroups(this)
|
||||
}.successUi {
|
||||
finish()
|
||||
}.failUi {
|
||||
hideLoader()
|
||||
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
val channel: Long = 1
|
||||
OpenGroupUtilities.addGroup(this, url, channel).success {
|
||||
MessageSender.syncAllOpenGroups(this)
|
||||
}.successUi {
|
||||
finish()
|
||||
}.failUi {
|
||||
hideLoader()
|
||||
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
// endregion
|
||||
|
@ -52,7 +52,9 @@ class ScanQRCodeWrapperFragment : Fragment(), ScanQRCodePlaceholderFragmentDeleg
|
||||
}
|
||||
|
||||
override fun onQrDataFound(string: String) {
|
||||
delegate?.handleQRCodeScanned(string)
|
||||
activity?.runOnUiThread {
|
||||
delegate?.handleQRCodeScanned(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user