diff --git a/src/components/BackupReminder.tsx b/src/components/BackupReminder.tsx index 245e1ad..9985605 100644 --- a/src/components/BackupReminder.tsx +++ b/src/components/BackupReminder.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; import { AlertTriangle, X, Download, CheckCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { useCurrentUser } from '@/hooks/useCurrentUser'; @@ -26,6 +27,7 @@ export function BackupReminder() { const [confirmed, setConfirmed] = useLocalStorage(BACKUP_CONFIRMED_KEY, false); const [showReminder, setShowReminder] = useState(false); const { t } = useTranslation(); + const navigate = useNavigate(); useEffect(() => { if (!user) { @@ -57,7 +59,13 @@ export function BackupReminder() { }; const handleBackupNow = () => { - window.location.href = '/settings?tab=security'; + // Client-side nav (HashRouter). window.location.href forced a full reload to + // a non-hash path the router couldn't match — it dropped the user on a blank + // page instead of the security settings. navigate() keeps it in-app. + setShowReminder(false); + // SettingsPage deep-links via ?section=… (NOT ?tab=…) — using the wrong + // param silently dropped the user on the settings root instead of Security. + navigate('/settings?section=security'); }; if (!showReminder) return null; diff --git a/src/components/WhosSkating.tsx b/src/components/WhosSkating.tsx index 116a58d..7a71539 100644 --- a/src/components/WhosSkating.tsx +++ b/src/components/WhosSkating.tsx @@ -1,4 +1,4 @@ -import { Link } from 'react-router-dom'; +import { Link, useNavigate } from 'react-router-dom'; import { nip19 } from 'nostr-tools'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; @@ -19,6 +19,7 @@ interface WhosSkatingProps { } function SkaterCard({ pubkey, status, emoji }: { pubkey: string; status: string; emoji?: string }) { + const navigate = useNavigate(); const { data: authorData, isLoading } = useAuthor(pubkey); const metadata = authorData?.metadata; const displayName = metadata?.name ?? genUserName(pubkey); @@ -68,8 +69,10 @@ function SkaterCard({ pubkey, status, emoji }: { pubkey: string; status: string; onClick={(e) => { e.preventDefault(); e.stopPropagation(); - // Navigate to DM - window.location.href = `/messages/${npub}`; + // Client-side navigation (HashRouter). Using window.location.href + // here caused a full reload to a non-hash path the router couldn't + // match — a broken jump. useNavigate keeps it in-app and instant. + navigate(`/messages/${npub}`); }} > diff --git a/src/pages/StashPage.tsx b/src/pages/StashPage.tsx index c2c306b..02ad816 100644 --- a/src/pages/StashPage.tsx +++ b/src/pages/StashPage.tsx @@ -733,7 +733,7 @@ export default function StashPage() {

Encryption Required

Your Stash is encrypted for privacy. Please use a signer that supports NIP-44 encryption (like Alby, nos2x, or Amber).

- +