+
Skip to content

Use pubkey relay if naddr does not provide relay hints #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ticruz38
Copy link
Collaborator

@ticruz38 ticruz38 commented Nov 18, 2024

Fallback to the pubkey write relays when naddr to not provide relay hints.

In deriveEvents, when loading the event, make sure we have some relay set in the request.
In NoteDetails and EventDetails, make sure we pass in some relays url so that we can load the event in the onMount callback

#448

@ticruz38 ticruz38 changed the title Fix/naddr relay hint Use pubkey relay if naddr does not provide relay hints Nov 18, 2024
@@ -16,10 +17,14 @@
<NoteDetail id={data} {relays} />
{:else if type === "naddr"}
{@const address = new Address(data.kind, data.pubkey, data.identifier).toString()}
{@const relays = [
...(data.relays || []),
...Array.from(ctx.app.router.FromPubkey(data.pubkey).getUrls()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Array.from shouldn't be necessary any more

@staab staab merged commit 62a2ef3 into coracle-social:dev Nov 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载