Ted Johansson 4a11d27982
FIX: Move chat integration problem check message to correct locale key (#201)
As part of enhancing problem checks and admin notices, we standardized the location of the problem check messages' locale keys. However, we overlooked this one in the plugin, resulting in a missing translation on the dashboard.

This PR puts the locale key in the place expected by the admin notice system.
2024-06-11 17:42:45 +08:00

22 lines
468 B
Ruby

# frozen_string_literal: true
class ProblemCheck::ChannelErrors < ProblemCheck
self.priority = "low"
def call
return no_problem if !SiteSetting.chat_integration_enabled
return no_problem if !channel_errors?
problem
end
private
def channel_errors?
DiscourseChatIntegration::Channel.find_each.any? do |channel|
channel.error_key.present? &&
::DiscourseChatIntegration::Provider.is_enabled(channel.provider)
end
end
end