When adding a plan to a course, don't ask users to go to existing course
This commit is contained in:
parent
71e7f9217e
commit
1112f7dbe2
1 changed files with 3 additions and 3 deletions
|
|
@ -95,11 +95,11 @@ class NewCoursePageState extends State<NewCoursePage> {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> _onSelect(CoursePlanModel course) async {
|
||||
Future<void> _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<NewCoursePage> {
|
|||
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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue