fix reindex notification filter

This commit is contained in:
simon 2023-04-08 17:18:42 +07:00
parent 1e96c3211f
commit 5d524e5110
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
6 changed files with 8 additions and 5 deletions

View File

@ -22,7 +22,7 @@
<a href="{% url 'downloads' %}?channel={{ channel_info.channel_id }}"><h3>Downloads</h3></a>
{% endif %}
</div>
<div id="notifications" data="channel"></div>
<div id="notifications" data="channel reindex"></div>
<div class="info-box info-box-2">
<div class="info-box-item">
<div class="round-img">

View File

@ -22,7 +22,7 @@
<a href="{% url 'downloads' %}?channel={{ channel_info.channel_id }}"><h3>Downloads</h3></a>
{% endif %}
</div>
<div id="notifications" data="channel"></div>
<div id="notifications" data="channel reindex"></div>
<div class="info-box info-box-3">
<div class="info-box-item">
<div class="round-img">

View File

@ -22,7 +22,7 @@
<a href="{% url 'downloads' %}?channel={{ channel_info.channel_id }}"><h3>Downloads</h3></a>
{% endif %}
</div>
<div id="notifications" data="channel"></div>
<div id="notifications" data="channel reindex"></div>
<div class="view-controls">
<div class="toggle">
<span>Show subscribed only:</span>

View File

@ -2,7 +2,7 @@
{% load static %}
{% block content %}
<div class="boxed-content">
<div id="notifications" data="setting"></div>
<div id="notifications" data="setting reindex"></div>
<div class="title-bar">
<h1>User Configurations</h1>
</div>

View File

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

View File

@ -136,6 +136,9 @@ function reindex(button) {
let message = document.createElement('p');
message.innerText = 'Reindex scheduled';
document.getElementById('reindex-button').replaceWith(message);
setTimeout(function () {
checkMessages();
}, 500);
}
// download page buttons