FIX: Only show admin dashboard errors when plugin/provider enabled (#117)

This commit is contained in:
David Taylor 2022-03-25 15:53:49 +00:00 committed by GitHub
parent 0c367e19ca
commit 8de3e498b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -29,9 +29,13 @@ after_initialize do
add_admin_route 'chat_integration.menu_title', 'chat-integration'
AdminDashboardData.add_problem_check do
break if !SiteSetting.chat_integration_enabled
error = false
DiscourseChatIntegration::Channel.find_each do |channel|
error = true unless channel.error_key.blank?
next if channel.error_key.blank?
next if !::DiscourseChatIntegration::Provider.is_enabled(channel.provider)
error = true
end
if error