create bot options before invite

This commit is contained in:
WilsonLe 2024-10-25 23:32:11 +07:00
parent 6e3950e5c7
commit 73026c39b3

View file

@ -241,6 +241,8 @@ class ConversationBotSettingsDialogState
updateFromTextControllers();
Navigator.of(context).pop(botOptions);
final bool isBotRoomMember =
await widget.room.botIsInRoom;
if (addBot && !isBotRoomMember) {
@ -248,8 +250,6 @@ class ConversationBotSettingsDialogState
} else if (!addBot && isBotRoomMember) {
await widget.room.kick(BotName.byEnvironment);
}
Navigator.of(context).pop(botOptions);
},
child: Text(L10n.of(context)!.confirm),
),