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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user