mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
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:
@@ -87,7 +87,7 @@ export async function isTagFollowed(collections, tag) {
|
|||||||
if (!ap_followed_tags) return false;
|
if (!ap_followed_tags) return false;
|
||||||
const normalizedTag = tag.toLowerCase().trim().replace(/^#/, "");
|
const normalizedTag = tag.toLowerCase().trim().replace(/^#/, "");
|
||||||
const doc = await ap_followed_tags.findOne({ tag: normalizedTag });
|
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
|
* @returns {string} Actor URL
|
||||||
*/
|
*/
|
||||||
export function getTagsPubActorUrl(tag) {
|
export function getTagsPubActorUrl(tag) {
|
||||||
return `https://tags.pub/user/${tag.toLowerCase()}`;
|
return `https://tags.pub/user/${tag.toLowerCase().replace(/^#/, "")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Infinite scroll sentinel (Task 5) #}
|
{# Infinite scroll load-more trigger #}
|
||||||
{% if before %}
|
{% if before %}
|
||||||
<div class="ap-load-more"
|
<div class="ap-load-more"
|
||||||
id="ap-load-more"
|
id="ap-load-more"
|
||||||
|
|||||||
Reference in New Issue
Block a user