diff --git a/lib/pangea/login/pages/course_code_page.dart b/lib/pangea/login/pages/course_code_page.dart index 026b0969a..1a976f54f 100644 --- a/lib/pangea/login/pages/course_code_page.dart +++ b/lib/pangea/login/pages/course_code_page.dart @@ -40,14 +40,17 @@ class CourseCodePageState extends State { return; } - final spaceId = await MatrixState.pangeaController.spaceCodeController + final roomId = await MatrixState.pangeaController.spaceCodeController .joinSpaceWithCode( context, _code, ); - if (spaceId != null) { - context.go('/rooms/spaces/$spaceId/details'); + if (roomId != null) { + final room = Matrix.of(context).client.getRoomById(roomId); + room?.isSpace ?? true + ? context.go('/rooms/spaces/$roomId/details') + : context.go('/rooms/$roomId'); } }