Skip to content

Commit

Permalink
create bot options before invite
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonLe committed Oct 25, 2024
1 parent 6e3950e commit 73026c3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ class ConversationBotSettingsDialogState

updateFromTextControllers();

Navigator.of(context).pop(botOptions);

final bool isBotRoomMember =
await widget.room.botIsInRoom;
if (addBot && !isBotRoomMember) {
await widget.room.invite(BotName.byEnvironment);
} else if (!addBot && isBotRoomMember) {
await widget.room.kick(BotName.byEnvironment);
}

Navigator.of(context).pop(botOptions);
},
child: Text(L10n.of(context)!.confirm),
),
Expand Down

0 comments on commit 73026c3

Please sign in to comment.