Files
bitvid/js/nostr/utils.js
T
google-labs-jules[bot]andPR0M3TH3AN 8b1bd5507d Refactor NostrClient into specialized managers
- Extracted persistence logic to `PersistenceManager`
- Extracted connection/pool logic to `ConnectionManager`
- Extracted signer/auth logic to `SignerManager`
- Updated `NostrClient` to delegate to these managers
- Fixed `SignerManager` implementation gaps (NIP-46 connect/restore)
- Verified with `tests/nostr/client.test.mjs`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 20:42:25 +00:00

13 lines
277 B
JavaScript

// js/nostr/utils.js
export function getActiveKey(video) {
if (video.videoRootId) {
return `ROOT:${video.videoRootId}`;
}
const dTag = video.tags?.find((t) => t[0] === "d");
if (dTag) {
return `${video.pubkey}:${dTag[1]}`;
}
return `LEGACY:${video.id}`;
}