Skip to content

Commit

Permalink
Merge pull request #723 from SnowCait/fix-npub-encode-error
Browse files Browse the repository at this point in the history
Fix npub encode error
  • Loading branch information
SnowCait authored Oct 16, 2023
2 parents ca235c7 + 4b16503 commit d08a297
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/routes/timeline/Note.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@
if (displayName !== undefined && displayName !== '') {
return displayName;
}
return nip19.npubEncode(pubkey).substring(0, 'npub1'.length + 7);

try {
return nip19.npubEncode(pubkey).substring(0, 'npub1'.length + 7);
} catch (error) {
console.error('[npub encode error]', pubkey);
return '-';
}
})
.join(' @')}
</span>
Expand Down

1 comment on commit d08a297

@vercel
Copy link

@vercel vercel bot commented on d08a297 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nostter – ./

nostter-snowcait.vercel.app
nostter-git-main-snowcait.vercel.app
nostter.vercel.app

Please sign in to comment.