mirror of
https://github.com/hoornet/vega.git
synced 2026-07-12 19:48:15 -07:00
Bump to v0.4.1 — media players, YouTube/Spotify cards, feed fix
Add inline video/audio players for direct media URLs, rich link cards for YouTube (with thumbnails), Vimeo, Spotify, and Tidal. Fix video clicks navigating to thread by splitting NoteContent into inline/media modes. Fix published notes not appearing on Following tab.
This commit is contained in:
@@ -5,7 +5,7 @@ import { useUserStore } from "../../stores/user";
|
||||
import { useFeedStore } from "../../stores/feed";
|
||||
import { shortenPubkey } from "../../lib/utils";
|
||||
|
||||
export function ComposeBox({ onPublished }: { onPublished?: () => void }) {
|
||||
export function ComposeBox({ onPublished, onNoteInjected }: { onPublished?: () => void; onNoteInjected?: (event: import("@nostr-dev-kit/ndk").NDKEvent) => void }) {
|
||||
const [text, setText] = useState("");
|
||||
const [publishing, setPublishing] = useState(false);
|
||||
const [uploading, setUploading] = useState(false);
|
||||
@@ -62,10 +62,14 @@ export function ComposeBox({ onPublished }: { onPublished?: () => void }) {
|
||||
try {
|
||||
const event = await publishNote(text.trim());
|
||||
// Inject into feed immediately so the user sees their post
|
||||
const { notes } = useFeedStore.getState();
|
||||
useFeedStore.setState({
|
||||
notes: [event, ...notes],
|
||||
});
|
||||
if (onNoteInjected) {
|
||||
onNoteInjected(event);
|
||||
} else {
|
||||
const { notes } = useFeedStore.getState();
|
||||
useFeedStore.setState({
|
||||
notes: [event, ...notes],
|
||||
});
|
||||
}
|
||||
setText("");
|
||||
textareaRef.current?.focus();
|
||||
onPublished?.();
|
||||
|
||||
Reference in New Issue
Block a user