From 0b4fc341a132de001c108f40deede83d98ab50c8 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Mon, 15 Jun 2026 22:24:56 +0700 Subject: [PATCH] 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 --- src/hooks/useDirectMessages.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/useDirectMessages.ts b/src/hooks/useDirectMessages.ts index 21c90ad..d3598cf 100644 --- a/src/hooks/useDirectMessages.ts +++ b/src/hooks/useDirectMessages.ts @@ -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;