fix(#240): parse session_id from params root (#242)

* fix(#240): parse session_id from params root

Allows correct session mapping when opening app via notification.

* fix(#240): set MainActivity launchMode to singleTop

Prevents activity destruction and WebSocket reconnection when tapping notifications.

* fix(#240): save inline notification replies to Room database

* fix(#240): refresh current session when app comes to foreground

* fix(#240): use uppercase role string to match Mapper mapping expectations

* style: format NotificationReplyReceiver.kt to satisfy ktlint
This commit is contained in:
M57 authored and GitHub committed 2026-06-21 19:04:54 +03:00
1 parent d7ca7b084e
commit bfef3613fa
6 files changed
+60 -1

No files matched your search

@@ -169,6 +169,7 @@ fun ChatScreen(
androidx.lifecycle.Lifecycle.Event.ON_START -> {
NotificationHelper.setAppForeground(context, true)
NotificationHelper.stop(context)
viewModel.refreshCurrentSession()
}
androidx.lifecycle.Lifecycle.Event.ON_STOP -> {
@@ -803,6 +803,12 @@ class ChatViewModel(
}
}
fun refreshCurrentSession() {
val sessionId = _uiState.value.currentSessionId ?: return
loadCachedMessages(sessionId)
loadSessionMessages(sessionId)
}
fun switchSession(sessionId: String) {
if (sessionId == _uiState.value.currentSessionId) return