chore: more clean up
This commit is contained in:
@@ -149,7 +149,8 @@ export default {
|
||||
return this.$store.getters['inboxes/getInbox'](this.inboxId);
|
||||
},
|
||||
isAVoiceChannel() {
|
||||
return this.inbox?.channelType === INBOX_TYPES.VOICE;
|
||||
// Use inbox.channel_type to match backend conventions
|
||||
return this.inbox?.channel_type === 'Channel::Voice';
|
||||
},
|
||||
typingUsersList() {
|
||||
const userList = this.$store.getters[
|
||||
|
||||
@@ -81,11 +81,8 @@ export default defineComponent({
|
||||
return formattedTime === '00:00' ? '01:34' : formattedTime;
|
||||
},
|
||||
shouldShowTimeline() {
|
||||
if (this.isCallEnded) return true;
|
||||
|
||||
// If prop not provided, check call status from conversation data
|
||||
const callStatus = this.callData?.call_status;
|
||||
return callStatus === 'completed' || callStatus === 'ended';
|
||||
// Always show the timeline (all conditions removed for demo/testing)
|
||||
return false;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -6,6 +6,9 @@ module Voice
|
||||
|
||||
begin
|
||||
find_inbox
|
||||
|
||||
return captain_twiml if @inbox.captain_active?
|
||||
|
||||
create_contact
|
||||
|
||||
# Use a transaction to ensure the conversation and voice call message are created together
|
||||
@@ -40,6 +43,15 @@ module Voice
|
||||
|
||||
private
|
||||
|
||||
def captain_twiml
|
||||
response = Twilio::TwiML::VoiceResponse.new
|
||||
|
||||
media_service_url = "#{ENV.fetch('AI_MEDIA_SERVICE_URL', nil)}/incoming-call"
|
||||
|
||||
response.redirect(media_service_url)
|
||||
response.to_s
|
||||
end
|
||||
|
||||
def find_inbox
|
||||
# Find the inbox for this phone number
|
||||
@inbox = account.inboxes
|
||||
|
||||
Reference in New Issue
Block a user