mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-21 22:13:11 +02:00
Fix null relay hints in DMs
This commit is contained in:
5
.changeset/four-foxes-lay.md
Normal file
5
.changeset/four-foxes-lay.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": patch
|
||||
---
|
||||
|
||||
Fix null relay hints in DMs
|
@@ -289,11 +289,13 @@ export function addPubkeyRelayHints(draft: DraftNostrEvent) {
|
||||
...draft,
|
||||
tags: draft.tags.map((t) => {
|
||||
if (isPTag(t) && !t[2]) {
|
||||
const newTag = [...t];
|
||||
const mailboxes = userMailboxesService.getMailboxes(t[1]).value;
|
||||
// TODO: Pick the best mailbox for the user
|
||||
if (mailboxes) newTag[2] = mailboxes.inbox.urls[0];
|
||||
return newTag;
|
||||
if (mailboxes && mailboxes.inbox.urls.length > 0) {
|
||||
const newTag = [...t];
|
||||
// TODO: Pick the best mailbox for the user
|
||||
newTag[2] = mailboxes.inbox.urls[0];
|
||||
return newTag;
|
||||
} else return t;
|
||||
}
|
||||
return t;
|
||||
}),
|
||||
|
@@ -7,11 +7,9 @@ import { Button, Flex, FlexProps, Heading } from "@chakra-ui/react";
|
||||
import { useSigningContext } from "../../../providers/global/signing-provider";
|
||||
import MagicTextArea, { RefType } from "../../../components/magic-textarea";
|
||||
import { useTextAreaUploadFileWithForm } from "../../../hooks/use-textarea-upload-file";
|
||||
import clientRelaysService from "../../../services/client-relays";
|
||||
import { DraftNostrEvent } from "../../../types/nostr-event";
|
||||
import { useDecryptionContext } from "../../../providers/global/dycryption-provider";
|
||||
import useUserMailboxes from "../../../hooks/use-user-mailboxes";
|
||||
import RelaySet from "../../../classes/relay-set";
|
||||
import { usePublishEvent } from "../../../providers/global/publish-provider";
|
||||
|
||||
export default function SendMessageForm({
|
||||
|
Reference in New Issue
Block a user