Reset ViewModels on logout/account switch

This commit introduces a `ResetModel()` function to `AgentViewModel` and `MineAgentViewModel` to clear their state.

This function is now called in `ResourceCleanupManager` and `AppState` during logout or when switching accounts to ensure that data from the previous session is not retained.

Additionally, the search and group name input fields in `CreateGroupChatScreen` are now single-line.
This commit is contained in:
2025-09-01 15:36:22 +08:00
parent 5c12982908
commit 36d322ef8c
5 changed files with 39 additions and 16 deletions

View File

@@ -197,6 +197,7 @@ fun CreateGroupChatScreen() {
fontSize = 14.sp
),
modifier = Modifier.weight(1f),
singleLine = true,
decorationBox = { innerTextField ->
Box {
if (searchText.text.isEmpty()) {
@@ -277,6 +278,7 @@ fun CreateGroupChatScreen() {
),
modifier = Modifier
.weight(1f),
singleLine = true,
decorationBox = { innerTextField ->
Box(Modifier.fillMaxWidth()) {
if (groupName.text.isEmpty()) {