Updated

app/models/apps/chatwoot/connection / refresh.rb

A
19 lines of codes
2 methods
4.1 complexity/method
4 churn
8.15 complexity
0 duplications
# frozen_string_literal: true class Apps::Chatwoot::Connection::Refresh
  1. Apps::Chatwoot::Connection::Refresh has no descriptive comment
def initialize(chatwoot) @chatwoot = chatwoot end def call return @chatwoot.inactive! if @chatwoot.invalid_token? inboxes = Accounts::Apps::Chatwoots::GetInboxes.call(@chatwoot) if inboxes.key?(:ok) @chatwoot.inboxes = inboxes[:ok] @chatwoot.save! end true end end