Sign Nostr event with ditto
This commit is contained in:
parent
a5c616312f
commit
85f526d1d4
1 changed files with 3 additions and 3 deletions
|
@ -181,12 +181,12 @@ const connectTimelineStream = (
|
||||||
case 'marker':
|
case 'marker':
|
||||||
dispatch({ type: MARKER_FETCH_SUCCESS, marker: JSON.parse(data.payload) });
|
dispatch({ type: MARKER_FETCH_SUCCESS, marker: JSON.parse(data.payload) });
|
||||||
break;
|
break;
|
||||||
case 'nostr:signEvent':
|
case 'nostr.sign':
|
||||||
(async () => {
|
(async () => {
|
||||||
const event = await window.nostr?.signEvent(JSON.parse(data.payload));
|
const event = await window.nostr?.signEvent(JSON.parse(data.payload));
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
websocket.send(JSON.stringify({ event: 'nostr:event', payload: event }));
|
websocket.send(JSON.stringify({ event: 'nostr.sign', payload: JSON.stringify(event) }));
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
break;
|
break;
|
||||||
|
@ -201,7 +201,7 @@ const refreshHomeTimelineAndNotification = (dispatch: AppDispatch, done?: () =>
|
||||||
dispatch(fetchAnnouncements(done))))));
|
dispatch(fetchAnnouncements(done))))));
|
||||||
|
|
||||||
const connectUserStream = (opts?: StreamOpts) =>
|
const connectUserStream = (opts?: StreamOpts) =>
|
||||||
connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification, null, opts);
|
connectTimelineStream('home', `user${'nostr' in window ? '&nostr=true' : ''}`, refreshHomeTimelineAndNotification, null, opts);
|
||||||
|
|
||||||
const connectCommunityStream = ({ onlyMedia }: Record<string, any> = {}) =>
|
const connectCommunityStream = ({ onlyMedia }: Record<string, any> = {}) =>
|
||||||
connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);
|
connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);
|
||||||
|
|
Loading…
Reference in a new issue