From 1112f7dbe2d5f7ac1d06ad7a9d91a5e65fa787c8 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Thu, 30 Oct 2025 09:53:07 -0400 Subject: [PATCH 1/2] When adding a plan to a course, don't ask users to go to existing course --- lib/pangea/login/pages/new_course_page.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pangea/login/pages/new_course_page.dart b/lib/pangea/login/pages/new_course_page.dart index 29994c8ca..1ff64bc1e 100644 --- a/lib/pangea/login/pages/new_course_page.dart +++ b/lib/pangea/login/pages/new_course_page.dart @@ -95,11 +95,11 @@ class NewCoursePageState extends State { } } - Future _onSelect(CoursePlanModel course) async { + Future _onSelect(CoursePlanModel course, bool isAddingPlan) async { final existingRoom = Matrix.of(context).client.getRoomByCourseId(course.uuid); - if (existingRoom == null) { + if (existingRoom == null || isAddingPlan) { context.go( widget.spaceId != null ? '/rooms/spaces/${widget.spaceId}/addcourse/${course.uuid}' @@ -286,7 +286,7 @@ class NewCoursePageState extends State { return Material( type: MaterialType.transparency, child: InkWell( - onTap: () => _onSelect(course), + onTap: () => _onSelect(course, spaceId != null), borderRadius: BorderRadius.circular(12.0), child: Container( padding: const EdgeInsets.all(12.0), From c747d51167a6e8c5a0094bec13f4190b8b066ffd Mon Sep 17 00:00:00 2001 From: Kelrap Date: Thu, 30 Oct 2025 10:11:21 -0400 Subject: [PATCH 2/2] Remove unneeded parameter --- lib/pangea/login/pages/new_course_page.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pangea/login/pages/new_course_page.dart b/lib/pangea/login/pages/new_course_page.dart index 1ff64bc1e..01a3bff97 100644 --- a/lib/pangea/login/pages/new_course_page.dart +++ b/lib/pangea/login/pages/new_course_page.dart @@ -95,11 +95,11 @@ class NewCoursePageState extends State { } } - Future _onSelect(CoursePlanModel course, bool isAddingPlan) async { + Future _onSelect(CoursePlanModel course) async { final existingRoom = Matrix.of(context).client.getRoomByCourseId(course.uuid); - if (existingRoom == null || isAddingPlan) { + if (existingRoom == null || widget.spaceId != null) { context.go( widget.spaceId != null ? '/rooms/spaces/${widget.spaceId}/addcourse/${course.uuid}' @@ -286,7 +286,7 @@ class NewCoursePageState extends State { return Material( type: MaterialType.transparency, child: InkWell( - onTap: () => _onSelect(course, spaceId != null), + onTap: () => _onSelect(course), borderRadius: BorderRadius.circular(12.0), child: Container( padding: const EdgeInsets.all(12.0),