mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 14:34:23 +01:00
Add the ability to deselect a task
This commit is contained in:
@@ -73,4 +73,11 @@ class TaskViewModel with ChangeNotifier {
|
||||
throw ArgumentError(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
/// Deselects the currently selected task.
|
||||
void deselectTask() {
|
||||
_selectedTask = null;
|
||||
print("Deselected the current task.");
|
||||
notifyListeners(); // Notify listeners to rebuild UI
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ class _TaskViewState extends State<TaskView> {
|
||||
final chatViewModel =
|
||||
Provider.of<ChatViewModel>(context, listen: false);
|
||||
chatViewModel.clearCurrentTaskAndChats();
|
||||
widget.viewModel.deselectTask();
|
||||
print(
|
||||
'New Task button pressed, cleared current task ID and chats');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user