mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
Fix chat older versions
This commit is contained in:
@ -43,7 +43,7 @@ const EncryptedChat: React.FC<Props> = ({
|
|||||||
status,
|
status,
|
||||||
}: Props): React.JSX.Element => {
|
}: Props): React.JSX.Element => {
|
||||||
const [turtleMode, setTurtleMode] = useState<boolean>(false);
|
const [turtleMode, setTurtleMode] = useState<boolean>(false);
|
||||||
const { hostUrl, settings } = useContext<UseAppStoreType>(AppContext);
|
const { settings } = useContext<UseAppStoreType>(AppContext);
|
||||||
const { garage } = useContext<UseGarageStoreType>(GarageContext);
|
const { garage } = useContext<UseGarageStoreType>(GarageContext);
|
||||||
const { federation } = useContext<UseFederationStoreType>(FederationContext);
|
const { federation } = useContext<UseFederationStoreType>(FederationContext);
|
||||||
|
|
||||||
@ -72,12 +72,13 @@ const EncryptedChat: React.FC<Props> = ({
|
|||||||
const sendToNostr = (content: string): void => {
|
const sendToNostr = (content: string): void => {
|
||||||
const slot = garage.getSlot();
|
const slot = garage.getSlot();
|
||||||
const coordinator = federation.getCoordinator(order.shortAlias);
|
const coordinator = federation.getCoordinator(order.shortAlias);
|
||||||
|
const publicKey = order.is_maker ? order.taker_nostr_pubkey : order.maker_nostr_pubkey;
|
||||||
|
|
||||||
if (!slot?.nostrSecKey) return;
|
if (!slot?.nostrSecKey || !publicKey) return;
|
||||||
|
|
||||||
const recipient = {
|
const recipient = {
|
||||||
publicKey: order.is_maker ? order.taker_nostr_pubkey : order.maker_nostr_pubkey,
|
publicKey,
|
||||||
relayUrl: coordinator.getRelayUrl(settings.network, hostUrl, settings.selfhostedClient),
|
relayUrl: coordinator.getRelayUrl(settings.network),
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
|
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
|
||||||
|
|||||||
Reference in New Issue
Block a user