diff --git a/lib/pages/new_group/new_group_view.dart b/lib/pages/new_group/new_group_view.dart index eb0fa605d..822b89214 100644 --- a/lib/pages/new_group/new_group_view.dart +++ b/lib/pages/new_group/new_group_view.dart @@ -86,6 +86,7 @@ class NewGroupView extends StatelessWidget { // ), ConversationBotSettings( key: controller.addConversationBotKey, + activeSpaceId: controller.activeSpaceId, ), const Divider(height: 1), AddToSpaceToggles( diff --git a/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart b/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart index 94214c8d2..0227c243a 100644 --- a/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart +++ b/lib/pangea/widgets/conversation_bot/conversation_bot_settings.dart @@ -20,12 +20,14 @@ import '../../utils/error_handler.dart'; class ConversationBotSettings extends StatefulWidget { final Room? room; final bool startOpen; + final String? activeSpaceId; // final ClassSettingsModel? initialSettings; const ConversationBotSettings({ super.key, this.room, this.startOpen = false, + this.activeSpaceId, // this.initialSettings, }); @@ -37,6 +39,7 @@ class ConversationBotSettingsState extends State { late BotOptionsModel botOptions; late bool isOpen; bool addBot = false; + Room? parentSpace; ConversationBotSettingsState({Key? key}); @@ -50,6 +53,12 @@ class ConversationBotSettingsState extends State { addBot = isBotRoom; }); }); + parentSpace = widget.activeSpaceId != null + ? Matrix.of(context).client.getRoomById(widget.activeSpaceId!) + : null; + if (parentSpace != null && botOptions.languageLevel == null) { + botOptions.languageLevel = parentSpace?.classSettings?.languageLevel; + } } Future updateBotOption(void Function() makeLocalChange) async {