feat: save event even when publishing fails

improve resiliency so that events are saved (backuped) before sending to relays
This commit is contained in:
DanConwayDev
2024-03-19 10:04:39 +00:00
parent 6f96a88698
commit 3111b33991

View File

@@ -306,6 +306,7 @@ export const getContactName = (pubkey: string): string => {
}; };
export const publishEvent = async (event: Event): Promise<boolean> => { export const publishEvent = async (event: Event): Promise<boolean> => {
storeMyProfileEvent(event);
const r = await publishEventToRelay( const r = await publishEventToRelay(
event, event,
[ [
@@ -317,7 +318,6 @@ export const publishEvent = async (event: Event): Promise<boolean> => {
'wss://relay.snort.social', 'wss://relay.snort.social',
], ],
); );
if (r) storeMyProfileEvent(event);
return r; return r;
}; };
/** /**