AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Add the ability to deselect a task
hunteraraujoa933f117fb5b
diff --git a/frontend/lib/viewmodels/task_viewmodel.dart b/frontend/lib/viewmodels/task_viewmodel.dartindex 4b9517b9b8..5423c18124 100644--- a/frontend/lib/viewmodels/task_viewmodel.dart+++ b/frontend/lib/viewmodels/task_viewmodel.dart@@ -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+ }}diff --git a/frontend/lib/views/task/task_view.dart b/frontend/lib/views/task/task_view.dartindex f681f536ea..73d64b48f9 100644--- a/frontend/lib/views/task/task_view.dart+++ b/frontend/lib/views/task/task_view.dart@@ -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');},