refactor(notes): remove redirect after repost publish
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m11s

This commit is contained in:
en 2025-02-25 12:55:57 +01:00
parent 88725da491
commit 840247f0b7
5 changed files with 3 additions and 11 deletions

View File

@ -184,7 +184,6 @@ export const Note = ({ ndkEvent }: NoteProps) => {
submit( submit(
JSON.stringify({ JSON.stringify({
intent: 'repost', intent: 'repost',
note1: ndkEvent.encode(),
data: rawEvent data: rawEvent
}), }),
{ {

View File

@ -114,7 +114,6 @@ export const Comment = ({ comment }: CommentProps) => {
submit( submit(
JSON.stringify({ JSON.stringify({
intent: 'repost', intent: 'repost',
note1: comment.event.encode(),
data: rawEvent data: rawEvent
}), }),
{ {

View File

@ -213,7 +213,6 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
submit( submit(
JSON.stringify({ JSON.stringify({
intent: 'repost', intent: 'repost',
note1: event.encode(),
data: rawEvent data: rawEvent
}), }),
{ {

View File

@ -56,11 +56,7 @@ export const feedPostRouteAction =
) )
case 'repost': case 'repost':
return await handleActionRepost( return await handleActionRepost(ndkContext.ndk, action.data)
ndkContext.ndk,
action.data,
action.note1
)
default: default:
throw new Error('Unsupported feed action. Intent missing.') throw new Error('Unsupported feed action. Intent missing.')
@ -134,7 +130,7 @@ async function handleActionSubmit(
return redirect(getFeedNotePageRoute(note1)) 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) const ndkEvent = new NDKEvent(ndk, data)
await ndkEvent.sign() await ndkEvent.sign()
@ -144,6 +140,6 @@ async function handleActionRepost(ndk: NDK, data: NostrEvent, note1: string) {
return null return null
} else { } else {
toast.success('Note published successfully') toast.success('Note published successfully')
return redirect(getFeedNotePageRoute(note1)) return null
} }
} }

View File

@ -14,7 +14,6 @@ export type NoteAction =
} }
| { | {
intent: 'repost' intent: 'repost'
note1: string
data: NostrEvent data: NostrEvent
} }