Merge pull request #1972 from RoboSats/catch-chat

Catch errors in chat
This commit is contained in:
KoalaSat
2025-05-29 14:04:35 +00:00
committed by GitHub
2 changed files with 11 additions and 10 deletions

View File

@ -8,7 +8,6 @@ import {
FederationContext,
type UseFederationStoreType,
} from '../../../contexts/FederationContext';
import { AppContext, UseAppStoreType } from '../../../contexts/AppContext';
interface Props {
order: Order;
@ -43,7 +42,6 @@ const EncryptedChat: React.FC<Props> = ({
status,
}: Props): React.JSX.Element => {
const [turtleMode, setTurtleMode] = useState<boolean>(false);
const { settings } = useContext<UseAppStoreType>(AppContext);
const { garage } = useContext<UseGarageStoreType>(GarageContext);
const { federation } = useContext<UseFederationStoreType>(FederationContext);
@ -76,18 +74,22 @@ const EncryptedChat: React.FC<Props> = ({
if (!slot?.nostrSecKey || !publicKey) return;
const recipient = {
publicKey,
relayUrl: coordinator.getRelayUrl(settings.network),
};
try {
const recipient = {
publicKey,
relayUrl: coordinator.getRelayUrl(coordinator.url),
};
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
const oneMonth = 2419200;
wrappedEvent.tags.push(['expiration', (wrappedEvent.created_at + oneMonth).toString()]);
federation.roboPool.sendEvent(wrappedEvent);
federation.roboPool.sendEvent(wrappedEvent);
} catch (error) {
console.error('Nostr nip17 error:', error);
}
};
return turtleMode ? (

View File

@ -1,7 +1,6 @@
identifier: com.robosats
name: Robosats
summary: A simple and private bitcoin exchange
release_repository: https://github.com/RoboSats/robosats
repository: https://github.com/RoboSats/robosats
images:
- ../../fastlane/metadata/en-US/images/phoneScreenshots/01.jpg
- ../../fastlane/metadata/en-US/images/phoneScreenshots/02.jpg