Fix nip19 decode type assertion by converting through unknown

Use double type assertion (as unknown as) to properly convert the discriminated
union type from nip19.decode(). This resolves all TypeScript type compatibility
issues across different versions.
This commit is contained in:
shakespeare.diy committed 2025-10-15 01:38:10 -05:00
1 parent 70fa01a640
commit 67aea6a3b2
1 file changed
+1 -1
+1 -1
View File
@@ -217,7 +217,7 @@ export function PullRequestDialog({
// Convert npub to hex if needed
if (pubkeyOrNpub.startsWith('npub1')) {
try {
const result = nip19.decode(pubkeyOrNpub) as { type: string; data: string };
const result = nip19.decode(pubkeyOrNpub) as unknown as { type: string; data: string };
// Validate that we got an npub (public key)
if (result.type === 'npub') {
owner = result.data;