fix: replace @noble/hashes/utils import with inline bytesToHex helper
@noble/hashes v2 dropped the ./utils subpath export, breaking the import in useDirectMessages.ts. Replaced with a simple inline implementation that has zero new dependencies and works correctly with any build tool. Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
parent
e29d35f1e4
commit
0b4fc341a1
1 changed files with 5 additions and 1 deletions
|
|
@ -2,11 +2,15 @@ import { useCallback, useMemo } from 'react';
|
|||
import { useNostr } from '@nostrify/react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { nip44, nip19, getEventHash, generateSecretKey, getPublicKey } from 'nostr-tools';
|
||||
import { bytesToHex } from '@noble/hashes/utils';
|
||||
|
||||
import type { NostrEvent } from '@nostrify/nostrify';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import { useAppContext } from './useAppContext';
|
||||
|
||||
// Uint8Array → hex string (replaces @noble/hashes/utils which dropped ./utils in v2)
|
||||
const bytesToHex = (bytes: Uint8Array): string =>
|
||||
Array.from(bytes).map(b => b.toString(16).padStart(2, '0')).join('');
|
||||
|
||||
// NIP-17 Message Types
|
||||
export interface DirectMessage {
|
||||
id: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue