mirror of
https://github.com/hoornet/vega.git
synced 2026-07-01 06:19:01 -07:00
Bump to v0.3.0 — instant post/reply feedback
Published notes now appear in the feed immediately. Thread replies show up without waiting for the relay round-trip. Includes all v0.2.9 fixes (image paste, sent zaps, reply-to clickable, feed refresh on login).
This commit is contained in:
@@ -166,12 +166,13 @@ export function ThreadView() {
|
||||
if (!replyText.trim() || replying) return;
|
||||
setReplying(true);
|
||||
try {
|
||||
await publishReply(replyText.trim(), { id: event.id, pubkey: event.pubkey });
|
||||
const replyEvent = await publishReply(replyText.trim(), { id: event.id, pubkey: event.pubkey });
|
||||
setReplyText("");
|
||||
setReplySent(true);
|
||||
// Re-fetch replies to show the new one
|
||||
const updated = await fetchReplies(event.id);
|
||||
setReplies(updated);
|
||||
// Inject reply locally so it appears immediately
|
||||
setReplies((prev) => [...prev, replyEvent]);
|
||||
// Also try fetching from relay in background
|
||||
fetchReplies(event.id).then((updated) => setReplies(updated));
|
||||
setTimeout(() => setReplySent(false), 2000);
|
||||
} finally {
|
||||
setReplying(false);
|
||||
|
||||
@@ -191,7 +191,7 @@ export async function publishReaction(eventId: string, eventPubkey: string, reac
|
||||
await event.publish();
|
||||
}
|
||||
|
||||
export async function publishReply(content: string, replyTo: { id: string; pubkey: string }): Promise<void> {
|
||||
export async function publishReply(content: string, replyTo: { id: string; pubkey: string }): Promise<NDKEvent> {
|
||||
const instance = getNDK();
|
||||
if (!instance.signer) throw new Error("Not logged in");
|
||||
|
||||
@@ -203,6 +203,7 @@ export async function publishReply(content: string, replyTo: { id: string; pubke
|
||||
["p", replyTo.pubkey],
|
||||
];
|
||||
await event.publish();
|
||||
return event;
|
||||
}
|
||||
|
||||
export async function publishNote(content: string): Promise<NDKEvent> {
|
||||
|
||||
Reference in New Issue
Block a user