fix: isTagFollowed false positive for global-only follows; # stripping in getTagsPubActorUrl

- isTagFollowed() now checks doc?.followedAt instead of !!doc, so it
  correctly returns false for global-only follows (document exists but
  no local followedAt)
- getTagsPubActorUrl() strips leading # so URLs like ?tag=%23indieweb
  don't produce invalid https://tags.pub/user/#indieweb actor URLs
- Remove stale "Task 5" plan reference comment in tag timeline template
This commit is contained in:
Ricardo
2026-03-22 00:25:29 +01:00
parent 944917b3f0
commit f69776b183
2 changed files with 3 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ export async function isTagFollowed(collections, tag) {
if (!ap_followed_tags) return false;
const normalizedTag = tag.toLowerCase().trim().replace(/^#/, "");
const doc = await ap_followed_tags.findOne({ tag: normalizedTag });
return !!doc;
return !!(doc?.followedAt);
}
/**
@@ -96,7 +96,7 @@ export async function isTagFollowed(collections, tag) {
* @returns {string} Actor URL
*/
export function getTagsPubActorUrl(tag) {
return `https://tags.pub/user/${tag.toLowerCase()}`;
return `https://tags.pub/user/${tag.toLowerCase().replace(/^#/, "")}`;
}
/**

View File

@@ -81,7 +81,7 @@
</nav>
{% endif %}
{# Infinite scroll sentinel (Task 5) #}
{# Infinite scroll load-more trigger #}
{% if before %}
<div class="ap-load-more"
id="ap-load-more"