mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Prioritize d tag in video pointer resolution
When creating address pointers (`a` tags) for watch history, `resolveVideoPointer` was incorrectly prioritizing `videoRootId` over the actual NIP-33 `d` tag. If these values differed (common in newly published videos), the resulting pointer would reference a non-existent identifier, causing subsequent hydration to fail. This change swaps the order to prioritize the `d` tag, ensuring watch history entries use the correct addressable identifier.
This commit is contained in:
1 parent
981c08f752
commit
f9ce798332
1 file changed
+6
-6
@@ -24,16 +24,16 @@ export function resolveVideoPointer({
|
||||
const pointerCandidates = [];
|
||||
const normalizedRelay = normalizeString(relay);
|
||||
|
||||
const rootId = normalizeString(videoRootId);
|
||||
if (rootId && normalizedPubkey) {
|
||||
const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${rootId}`];
|
||||
const normalizedDTag = normalizeString(dTag);
|
||||
if (normalizedDTag && normalizedPubkey) {
|
||||
const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${normalizedDTag}`];
|
||||
if (normalizedRelay) ptr.push(normalizedRelay);
|
||||
pointerCandidates.push(ptr);
|
||||
}
|
||||
|
||||
const normalizedDTag = normalizeString(dTag);
|
||||
if (normalizedDTag && normalizedPubkey) {
|
||||
const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${normalizedDTag}`];
|
||||
const rootId = normalizeString(videoRootId);
|
||||
if (rootId && normalizedPubkey) {
|
||||
const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${rootId}`];
|
||||
if (normalizedRelay) ptr.push(normalizedRelay);
|
||||
pointerCandidates.push(ptr);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user