mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
fix(nostr): implement missing resolveEventDTag in NostrClient
Added the `resolveEventDTag` method to the `NostrClient` class in `js/nostr/client.js`. This method was referenced in `editVideo` and `hydrateVideoHistory` but was missing from the implementation, causing `TypeError` in tests. The implementation delegates to `getDTagValueFromTags` from `js/nostr/nip71.js`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
25551592ad
commit
56b23be427
1 file changed
+12
@@ -927,6 +927,18 @@ export class NostrClient {
|
||||
return this.connectionManager.makeCountUnsupportedError(relayUrl);
|
||||
}
|
||||
|
||||
resolveEventDTag(event, fallbackEvent = null) {
|
||||
if (event && event.tags) {
|
||||
const dTag = getDTagValueFromTags(event.tags);
|
||||
if (dTag) return dTag;
|
||||
}
|
||||
if (fallbackEvent && fallbackEvent.tags) {
|
||||
const dTag = getDTagValueFromTags(fallbackEvent.tags);
|
||||
if (dTag) return dTag;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
applyRootCreatedAt(video) {
|
||||
if (!video || typeof video !== "object") return;
|
||||
const rootId = video.videoRootId;
|
||||
|
||||
Reference in new issue
Block a user