refactor: tidy connected bot ownership flow

This commit is contained in:
Sojan Jose
2026-07-22 17:06:52 -07:00
parent af6389bdd8
commit 2750321830
2 changed files with 2 additions and 2 deletions
@@ -181,7 +181,7 @@ class Api::V1::Accounts::ConversationsController < Api::V1::Accounts::BaseContro
def handle_human_open
@conversation.assignee_agent_bot = nil
@conversation.assignee = current_user if current_user.agent?
@conversation.assignee = Current.user if Current.user.agent?
@conversation.save!
end
+1 -1
View File
@@ -300,10 +300,10 @@ class Conversation < ApplicationRecord
end
def set_active_bot_conversation
# TODO: make this an inbox config instead of assuming bot conversations should start as pending
self.status = :pending
return unless inbox.agent_bot_inbox&.active? && assignee_id.blank?
self.assignee = nil
self.assignee_agent_bot = inbox.agent_bot
end