Skip to content

Commit

Permalink
Merge pull request #853 from pangeachat/reorder-invite-bot-operations
Browse files Browse the repository at this point in the history
create bot options before invite
  • Loading branch information
ggurdin authored Oct 25, 2024
2 parents 6e3950e + 73026c3 commit d3d7acd
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 d3d7acd

Please sign in to comment.