mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
- 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]>
13 lines
277 B
JavaScript
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}`;
|
|
}
|