Skip to content

Commit

Permalink
fix login switch rtm cannot receive message
Browse files Browse the repository at this point in the history
  • Loading branch information
aderan committed Sep 12, 2024
1 parent 31b2306 commit 3ee4c6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/io/agora/flat/PostLoginInitializers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ class PostLoginInitializers @Inject constructor(
@ApplicationContext val context: Context,
private val initializers: Set<@JvmSuppressWildcards PostLoginInitializer>,
) {
private var inited = false

fun init() {
if (inited) return
initializers.forEach {
it.init(context)
}
inited = true
}
}
1 change: 1 addition & 0 deletions app/src/main/java/io/agora/flat/common/rtm/AgoraRtm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AgoraRtm @Inject constructor(
private var rtmListeners = mutableListOf<RtmListener>()

override fun init(context: Context) {
RtmClient.release()
try {
val config = RtmConfig.Builder(appEnv.agoraAppId, appKVCenter.getUserInfo()?.uuid)
.eventListener(this)
Expand Down

0 comments on commit 3ee4c6f

Please sign in to comment.