show all messages on settings pages

This commit is contained in:
Simon 2023-08-31 12:16:17 +07:00
parent fcc1c2a648
commit 4afb605736
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 10 additions and 4 deletions

View File

@ -10,7 +10,7 @@
<a href="{% url 'settings_scheduling' %}"><h3>Scheduling</h3></a>
<a href="{% url 'settings_actions' %}"><h3>Actions</h3></a>
</div>
<div id="notifications" data="setting reindex"></div>
<div id="notifications" data=""></div>
{% block settings_content %}{% endblock %}
</div>
<script type="text/javascript" src="{% static 'progress.js' %}"></script>

View File

@ -30,9 +30,15 @@ function getMessages(dataOrigin) {
function buildMessage(responseData, dataOrigin) {
// filter relevant messages
let messages = responseData.filter(function (value) {
return dataOrigin.split(' ').includes(value.group.split(':')[0]);
}, dataOrigin);
let messages;
if (dataOrigin) {
messages = responseData.filter(function (value) {
return dataOrigin.split(' ').includes(value.group.split(':')[0]);
}, dataOrigin);
} else {
messages = responseData;
}
let notifications = document.getElementById('notifications');
let currentNotifications = notifications.childElementCount;