From 7985743382467843ff604ad46fbd5655f57f28b6 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Mon, 15 Jul 2024 10:02:05 -0400 Subject: [PATCH 1/4] Fix loading issue when space is selected? --- lib/pages/chat_list/space_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index f3f9749a1..cf5913a25 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -126,7 +126,7 @@ class _SpaceViewState extends State { try { final response = await client.getSpaceHierarchy( activeSpaceId, - maxDepth: 1, + maxDepth: 2, from: prevBatch, ); From 899a128118cbb6b46ab612515988c6a7d8277083 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 16 Jul 2024 12:23:40 -0400 Subject: [PATCH 2/4] Fix loading issue for realsies --- lib/pages/chat_list/space_view.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index cf5913a25..ef938c235 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -126,8 +126,11 @@ class _SpaceViewState extends State { try { final response = await client.getSpaceHierarchy( activeSpaceId, - maxDepth: 2, + maxDepth: 1, from: prevBatch, + // #Pangea + limit: 100, + // Pangea# ); if (prevBatch != null) { From 2fbc4e2016496e7db9fee05c9d1a5c9877ee652b Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 16 Jul 2024 13:59:45 -0400 Subject: [PATCH 3/4] Doesn't add welcome chat to subspace --- lib/pages/login/login_view.dart | 2 +- lib/pages/new_space/new_space.dart | 32 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index a50567eea..818dd06b4 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -147,7 +147,7 @@ class LoginView extends StatelessWidget { controller.showPassword ? Icons.visibility_off_outlined : Icons.visibility_outlined, - color: Colors.black, + // color: Colors.black, ), ), ), diff --git a/lib/pages/new_space/new_space.dart b/lib/pages/new_space/new_space.dart index 1903a6200..d5e41410d 100644 --- a/lib/pages/new_space/new_space.dart +++ b/lib/pages/new_space/new_space.dart @@ -198,14 +198,18 @@ class NewSpaceController extends State { if (capacity != null && space != null) { space.updateRoomCapacity(capacity); } - final newChatRoomId = await Matrix.of(context).client.createGroupChat( - enableEncryption: false, - preset: sdk.CreateRoomPreset.publicChat, - // Welcome chat name is '[space name acronym]: Welcome Chat' - groupName: - '${nameController.text.trim().split(RegExp(r"\s+")).map((s) => s[0]).join()}: ${L10n.of(context)!.classWelcomeChat}', - ); - GoogleAnalytics.createChat(newChatRoomId); + // If space has no parents, add welcome chat + String? newChatRoomId; + if (space?.pangeaSpaceParents.isEmpty ?? false) { + newChatRoomId = await Matrix.of(context).client.createGroupChat( + enableEncryption: false, + preset: sdk.CreateRoomPreset.publicChat, + // Welcome chat name is '[space name acronym]: Welcome Chat' + groupName: + '${nameController.text.trim().split(RegExp(r"\s+")).map((s) => s[0]).join()}: ${L10n.of(context)!.classWelcomeChat}', + ); + GoogleAnalytics.createChat(newChatRoomId); + } final Room? room = Matrix.of(context).client.getRoomById(spaceId); if (room == null) { @@ -217,11 +221,13 @@ class NewSpaceController extends State { return; } - room.setSpaceChild(newChatRoomId, suggested: true); - GoogleAnalytics.addParent( - newChatRoomId, - room.classCode, - ); + if (newChatRoomId != null) { + room.setSpaceChild(newChatRoomId, suggested: true); + GoogleAnalytics.addParent( + newChatRoomId, + room.classCode, + ); + } GoogleAnalytics.createClass(room.name, room.classCode); try { From 5a06e708020671945d60bafb626abd9ee35fc32d Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 16 Jul 2024 14:36:15 -0400 Subject: [PATCH 4/4] Do not create welcome chats under any circumstance --- lib/pages/new_space/new_space.dart | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/pages/new_space/new_space.dart b/lib/pages/new_space/new_space.dart index d5e41410d..57462a698 100644 --- a/lib/pages/new_space/new_space.dart +++ b/lib/pages/new_space/new_space.dart @@ -198,18 +198,6 @@ class NewSpaceController extends State { if (capacity != null && space != null) { space.updateRoomCapacity(capacity); } - // If space has no parents, add welcome chat - String? newChatRoomId; - if (space?.pangeaSpaceParents.isEmpty ?? false) { - newChatRoomId = await Matrix.of(context).client.createGroupChat( - enableEncryption: false, - preset: sdk.CreateRoomPreset.publicChat, - // Welcome chat name is '[space name acronym]: Welcome Chat' - groupName: - '${nameController.text.trim().split(RegExp(r"\s+")).map((s) => s[0]).join()}: ${L10n.of(context)!.classWelcomeChat}', - ); - GoogleAnalytics.createChat(newChatRoomId); - } final Room? room = Matrix.of(context).client.getRoomById(spaceId); if (room == null) { @@ -221,14 +209,6 @@ class NewSpaceController extends State { return; } - if (newChatRoomId != null) { - room.setSpaceChild(newChatRoomId, suggested: true); - GoogleAnalytics.addParent( - newChatRoomId, - room.classCode, - ); - } - GoogleAnalytics.createClass(room.name, room.classCode); try { await room.invite(BotName.byEnvironment);