Open automatically chat or call history screen when baresip icon with notification dot is touuched
This commit is contained in:
@ -16,6 +16,7 @@ import kotlinx.coroutines.launch
|
||||
// Sealed class for type-safe navigation events
|
||||
sealed class NavigationCommand {
|
||||
object NavigateToHome : NavigationCommand()
|
||||
object NavigateToChats : NavigationCommand()
|
||||
data class NavigateToCalls(val aor: String) : NavigationCommand()
|
||||
data class NavigateToChat(val aor: String, val peerUri: String) : NavigationCommand()
|
||||
}
|
||||
@ -31,11 +32,10 @@ class ViewModel: ViewModel() {
|
||||
|
||||
fun updateAorPeerMessage(aor: String, peerUri: String, message: String) {
|
||||
val key = "$aor:$peerUri"
|
||||
if (message.isEmpty()) {
|
||||
if (message.isEmpty())
|
||||
messageDrafts.remove(key)
|
||||
} else {
|
||||
else
|
||||
messageDrafts[key] = message
|
||||
}
|
||||
}
|
||||
|
||||
data class DialerState(
|
||||
@ -162,4 +162,10 @@ class ViewModel: ViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
fun navigateToChats() {
|
||||
viewModelScope.launch {
|
||||
_navigationCommand.emit(NavigationCommand.NavigateToChats)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user