@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-microsub",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "Microsub endpoint for Indiekit. Enables subscribing to feeds and reading content using the Microsub protocol.",
5
5
  "keywords": [
6
6
  "indiekit",
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(microsubApiUrl, {
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
  });