Fix alert for multiple integrations (#19410)

This commit is contained in:
Joakim Sørensen 2021-09-21 09:37:28 +02:00 committed by GitHub
parent d3e378ff3e
commit dcb7f028d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,10 +13,12 @@ layout: default
{% if page.collection == "integrations" %} {% if page.collection == "integrations" %}
{% assign active_alert = "" %} {% assign active_alert = "" %}
{% for alert in site.data.alerts_data %} {% for alert in site.data.alerts_data %}
{% if alert.integrations and alert.integrations[0].package == page.ha_domain %} {% for integration in alert.integrations %}
{% if integration.package == page.ha_domain %}
{% assign active_alert = alert.alert_url %} {% assign active_alert = alert.alert_url %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %}
{% if active_alert != "" %} {% if active_alert != "" %}
<div class="integration-alert"> <div class="integration-alert">
<a href="{{active_alert}}" target="_blank">⚠️ There is an active alert for this integration!</a> <a href="{{active_alert}}" target="_blank">⚠️ There is an active alert for this integration!</a>