From 8de3e498b2814ffd87220b4de8051577abf8c5de Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 25 Mar 2022 15:53:49 +0000 Subject: [PATCH] FIX: Only show admin dashboard errors when plugin/provider enabled (#117) --- plugin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 56507c3..79acff1 100644 --- a/plugin.rb +++ b/plugin.rb @@ -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