mirror of
https://github.com/hoornet/vega.git
synced 2026-04-24 14:50:00 -07:00
Bump to v0.2.1 — Batch 3 playtest fixes + auto-updater fix
- Fix: repost + quote buttons added to RootNote in ThreadView (Issue A) - Fix: switchAccount no longer silently goes read-only when nsec keychain entry is missing — nsec accounts stay logged out so the login button handles recovery; loginType field added to SavedAccount (Issue B) - Fix: macos-12 runner replaced with macos-13 in release.yml — macos-12 was deprecated by GitHub, causing macOS jobs to never run, which prevented latest.json from being assembled and broke the auto-updater for every user since v0.1.5 - Bump Cargo.toml version (was stuck at 0.1.10) - Release notes updated with v0.2.1 + v0.2.0 Phase 2 changelog - README: Windows unsigned installer note added - ROADMAP: NIP-05 monetization added to brainstorm backlog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,8 @@ import { useUserStore } from "../../stores/user";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import { useReactionCount } from "../../hooks/useReactionCount";
|
||||
import { useZapCount } from "../../hooks/useZapCount";
|
||||
import { fetchReplies, publishReaction, publishReply, getNDK } from "../../lib/nostr";
|
||||
import { fetchReplies, publishReaction, publishReply, publishRepost, getNDK } from "../../lib/nostr";
|
||||
import { QuoteModal } from "../feed/QuoteModal";
|
||||
import { shortenPubkey, timeAgo } from "../../lib/utils";
|
||||
import { NoteContent } from "../feed/NoteContent";
|
||||
import { NoteCard } from "../feed/NoteCard";
|
||||
@@ -27,6 +28,9 @@ function RootNote({ event }: { event: NDKEvent }) {
|
||||
});
|
||||
const [liking, setLiking] = useState(false);
|
||||
const [showZap, setShowZap] = useState(false);
|
||||
const [reposting, setReposting] = useState(false);
|
||||
const [reposted, setReposted] = useState(false);
|
||||
const [showQuote, setShowQuote] = useState(false);
|
||||
const hasLightning = !!(profile?.lud16 || profile?.lud06);
|
||||
|
||||
const handleLike = async () => {
|
||||
@@ -44,6 +48,17 @@ function RootNote({ event }: { event: NDKEvent }) {
|
||||
}
|
||||
};
|
||||
|
||||
const handleRepost = async () => {
|
||||
if (reposting || reposted) return;
|
||||
setReposting(true);
|
||||
try {
|
||||
await publishRepost(event);
|
||||
setReposted(true);
|
||||
} finally {
|
||||
setReposting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="px-4 py-4 border-b border-border">
|
||||
<div className="flex gap-3 mb-3">
|
||||
@@ -79,6 +94,21 @@ function RootNote({ event }: { event: NDKEvent }) {
|
||||
>
|
||||
{liked ? "♥" : "♡"}{reactionCount !== null && reactionCount > 0 ? ` ${reactionCount}` : liked ? " liked" : " like"}
|
||||
</button>
|
||||
<button
|
||||
onClick={handleRepost}
|
||||
disabled={reposting || reposted}
|
||||
className={`text-[11px] transition-colors disabled:cursor-default ${
|
||||
reposted ? "text-accent" : "text-text-dim hover:text-accent"
|
||||
}`}
|
||||
>
|
||||
{reposted ? "reposted ✓" : reposting ? "…" : "repost"}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setShowQuote(true)}
|
||||
className="text-[11px] text-text-dim hover:text-text transition-colors"
|
||||
>
|
||||
quote
|
||||
</button>
|
||||
{hasLightning && (
|
||||
<button
|
||||
onClick={() => setShowZap(true)}
|
||||
@@ -99,6 +129,15 @@ function RootNote({ event }: { event: NDKEvent }) {
|
||||
onClose={() => setShowZap(false)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{showQuote && (
|
||||
<QuoteModal
|
||||
event={event}
|
||||
authorName={name}
|
||||
authorAvatar={avatar}
|
||||
onClose={() => setShowQuote(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user