Пуши
This commit is contained in:
@@ -50,6 +50,7 @@ class ChatDetailViewModel @Inject constructor(
|
||||
private val signalrClient: ChatHubClient,
|
||||
private val serverConfig: ServerConfig,
|
||||
private val tokenManager: TokenManager,
|
||||
private val activeChatTracker: core.notifications.data.ActiveChatTracker,
|
||||
@dagger.hilt.android.qualifiers.ApplicationContext private val context: android.content.Context
|
||||
) : ViewModel() {
|
||||
|
||||
@@ -88,6 +89,7 @@ class ChatDetailViewModel @Inject constructor(
|
||||
fun setChatId(chatId: String) {
|
||||
if (currentChatId == chatId) return
|
||||
currentChatId = chatId
|
||||
activeChatTracker.setChatId(chatId)
|
||||
|
||||
_state.update { it.copy(
|
||||
messages = emptyList(),
|
||||
@@ -248,6 +250,7 @@ class ChatDetailViewModel @Inject constructor(
|
||||
signalrEventsJob?.cancel()
|
||||
signalrEventsJob = null
|
||||
currentChatId = null
|
||||
activeChatTracker.setChatId(null)
|
||||
_state.update { it.copy(messages = emptyList(), isLoading = false) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user