@rmdes/indiekit-endpoint-microsub 1.0.53 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/locales/en.json +1 -1
- package/package.json +1 -1
- package/views/channel.njk +4 -3
package/locales/en.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Reader",
|
|
5
5
|
"empty": "No items to display",
|
|
6
6
|
"markAllRead": "Mark all as read",
|
|
7
|
-
"markViewRead": "Mark view as read",
|
|
7
|
+
"markViewRead": "Mark current view as read",
|
|
8
8
|
"showRead": "Show read ({{count}})",
|
|
9
9
|
"hideRead": "Hide read items",
|
|
10
10
|
"allRead": "All caught up!",
|
package/package.json
CHANGED
package/views/channel.njk
CHANGED
|
@@ -381,10 +381,11 @@
|
|
|
381
381
|
window.__microsubLoadMore = loadMore;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
// === Mark view as read button ===
|
|
384
|
+
// === Mark current view as read button ===
|
|
385
385
|
const markViewBtn = document.querySelector('.js-mark-view-read');
|
|
386
386
|
if (markViewBtn && timeline) {
|
|
387
387
|
markViewBtn.style.display = '';
|
|
388
|
+
const markViewApiUrl = '{{ baseUrl }}'.replace(/\/reader$/, '');
|
|
388
389
|
|
|
389
390
|
markViewBtn.addEventListener('click', async () => {
|
|
390
391
|
const unreadCards = timeline.querySelectorAll('.ms-item-card:not(.ms-item-card--read)');
|
|
@@ -403,7 +404,7 @@
|
|
|
403
404
|
}
|
|
404
405
|
|
|
405
406
|
try {
|
|
406
|
-
const response = await fetch(
|
|
407
|
+
const response = await fetch(markViewApiUrl, {
|
|
407
408
|
method: 'POST',
|
|
408
409
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
409
410
|
body: formData.toString(),
|
|
@@ -431,7 +432,7 @@
|
|
|
431
432
|
markViewBtn.disabled = false;
|
|
432
433
|
}
|
|
433
434
|
} catch (error) {
|
|
434
|
-
console.error('Error marking view as read:', error);
|
|
435
|
+
console.error('Error marking current view as read:', error);
|
|
435
436
|
markViewBtn.disabled = false;
|
|
436
437
|
}
|
|
437
438
|
});
|