diff --git a/commonmodule/src/main/java/com/sendbird/chat/module/ui/base/BaseSplashActivity.kt b/commonmodule/src/main/java/com/sendbird/chat/module/ui/base/BaseSplashActivity.kt index 7289673..fa0327d 100644 --- a/commonmodule/src/main/java/com/sendbird/chat/module/ui/base/BaseSplashActivity.kt +++ b/commonmodule/src/main/java/com/sendbird/chat/module/ui/base/BaseSplashActivity.kt @@ -33,14 +33,15 @@ open class BaseSplashActivity : AppCompatActivity() { startActivity(intent) finish() } else { - SendbirdChat.connect(userId) { _, e -> - if (e != null) { - showToast("$e") - finish() - return@connect + SendbirdChat.connect(userId) { user, e -> + if (user != null) { + val intent = Intent("$packageName.MAIN") + startActivity(intent) + } else { + if (e != null) { + showToast("$e") + } } - val intent = Intent("$packageName.MAIN") - startActivity(intent) finish() } } diff --git a/groupchannel-typingindicator/src/main/java/com/sendbird/chat/sample/typingindicator/ui/groupchannel/GroupChannelChatActivity.kt b/groupchannel-typingindicator/src/main/java/com/sendbird/chat/sample/typingindicator/ui/groupchannel/GroupChannelChatActivity.kt index cd26bf7..5b82736 100644 --- a/groupchannel-typingindicator/src/main/java/com/sendbird/chat/sample/typingindicator/ui/groupchannel/GroupChannelChatActivity.kt +++ b/groupchannel-typingindicator/src/main/java/com/sendbird/chat/sample/typingindicator/ui/groupchannel/GroupChannelChatActivity.kt @@ -169,19 +169,18 @@ class GroupChannelChatActivity : AppCompatActivity() { GroupChannel.getChannel( channelUrl ) getChannelLabel@{ groupChannel, e -> - if (e != null) { - showToast("${e.message}") - return@getChannelLabel - } if (groupChannel != null) { currentGroupChannel = groupChannel setChannelTitle() createMessageCollection(channelTSHashMap[channelUrl] ?: Long.MAX_VALUE) setupTypingListener() + } else { + if (e != null) { + showToast("${e.message}") + } } } } - private fun setChannelTitle() { val currentChannel = currentGroupChannel if (channelTitle == TextUtils.CHANNEL_DEFAULT_NAME && currentChannel != null) { @@ -221,9 +220,6 @@ class GroupChannelChatActivity : AppCompatActivity() { cachedList: List?, e: SendbirdException? ) { - if (e != null) { - showToast("${e.message}") - } adapter.changeMessages(cachedList) adapter.addPendingMessages(this@apply.pendingMessages) } @@ -232,11 +228,14 @@ class GroupChannelChatActivity : AppCompatActivity() { apiResultList: List?, e: SendbirdException? ) { - if (e != null) { - showToast("${e.message}") + if (apiResultList != null) { + adapter.changeMessages(apiResultList, false) + markAsRead() + } else { + if (e != null) { + showToast("${e.message}") + } } - adapter.changeMessages(apiResultList, false) - markAsRead() isCollectionInitialized = true } } @@ -673,4 +672,4 @@ class GroupChannelChatActivity : AppCompatActivity() { } } } -} \ No newline at end of file +}