diff --git a/app/src/main/java/io/agora/flat/PostLoginInitializers.kt b/app/src/main/java/io/agora/flat/PostLoginInitializers.kt index fc276bf7..e9cf8a19 100644 --- a/app/src/main/java/io/agora/flat/PostLoginInitializers.kt +++ b/app/src/main/java/io/agora/flat/PostLoginInitializers.kt @@ -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 } } diff --git a/app/src/main/java/io/agora/flat/common/rtm/AgoraRtm.kt b/app/src/main/java/io/agora/flat/common/rtm/AgoraRtm.kt index 5509aad6..6c6568e3 100644 --- a/app/src/main/java/io/agora/flat/common/rtm/AgoraRtm.kt +++ b/app/src/main/java/io/agora/flat/common/rtm/AgoraRtm.kt @@ -53,6 +53,7 @@ class AgoraRtm @Inject constructor( private var rtmListeners = mutableListOf() override fun init(context: Context) { + RtmClient.release() try { val config = RtmConfig.Builder(appEnv.agoraAppId, appKVCenter.getUserInfo()?.uuid) .eventListener(this)