refactor(notes): remove redirect after repost publish
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m11s
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m11s
This commit is contained in:
parent
88725da491
commit
840247f0b7
@ -184,7 +184,6 @@ export const Note = ({ ndkEvent }: NoteProps) => {
|
||||
submit(
|
||||
JSON.stringify({
|
||||
intent: 'repost',
|
||||
note1: ndkEvent.encode(),
|
||||
data: rawEvent
|
||||
}),
|
||||
{
|
||||
|
@ -114,7 +114,6 @@ export const Comment = ({ comment }: CommentProps) => {
|
||||
submit(
|
||||
JSON.stringify({
|
||||
intent: 'repost',
|
||||
note1: comment.event.encode(),
|
||||
data: rawEvent
|
||||
}),
|
||||
{
|
||||
|
@ -213,7 +213,6 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
|
||||
submit(
|
||||
JSON.stringify({
|
||||
intent: 'repost',
|
||||
note1: event.encode(),
|
||||
data: rawEvent
|
||||
}),
|
||||
{
|
||||
|
@ -56,11 +56,7 @@ export const feedPostRouteAction =
|
||||
)
|
||||
|
||||
case 'repost':
|
||||
return await handleActionRepost(
|
||||
ndkContext.ndk,
|
||||
action.data,
|
||||
action.note1
|
||||
)
|
||||
return await handleActionRepost(ndkContext.ndk, action.data)
|
||||
|
||||
default:
|
||||
throw new Error('Unsupported feed action. Intent missing.')
|
||||
@ -134,7 +130,7 @@ async function handleActionSubmit(
|
||||
return redirect(getFeedNotePageRoute(note1))
|
||||
}
|
||||
}
|
||||
async function handleActionRepost(ndk: NDK, data: NostrEvent, note1: string) {
|
||||
async function handleActionRepost(ndk: NDK, data: NostrEvent) {
|
||||
const ndkEvent = new NDKEvent(ndk, data)
|
||||
await ndkEvent.sign()
|
||||
|
||||
@ -144,6 +140,6 @@ async function handleActionRepost(ndk: NDK, data: NostrEvent, note1: string) {
|
||||
return null
|
||||
} else {
|
||||
toast.success('Note published successfully')
|
||||
return redirect(getFeedNotePageRoute(note1))
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ export type NoteAction =
|
||||
}
|
||||
| {
|
||||
intent: 'repost'
|
||||
note1: string
|
||||
data: NostrEvent
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user