fix: correct 'Manage API Keys' link from /pair success screen
- Profile page now reads ?tab= query param to open Settings tab directly - Settings container reads ?subtab= query param to open API Keys directly - /pair success link updated to /profile?tab=settings&subtab=api-keys (was /profile/settings?tab=api-keys which 404'd)
This commit is contained in:
@@ -170,7 +170,7 @@ function PairContent() {
|
||||
was created. You can close this page and return to your Steam Deck.
|
||||
</p>
|
||||
<Link
|
||||
href="/profile/settings?tab=api-keys"
|
||||
href="/profile?tab=settings&subtab=api-keys"
|
||||
className="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-white text-sm font-medium hover:bg-primary/90 transition-colors"
|
||||
>
|
||||
Manage API Keys
|
||||
|
||||
@@ -17,7 +17,12 @@ type Tab = "overview" | "saved" | "settings"
|
||||
export default function ProfilePage() {
|
||||
const router = useRouter()
|
||||
const { data: session, isPending: isSessionLoading } = useSession()
|
||||
const [activeTab, setActiveTab] = useState<Tab>("overview")
|
||||
const [activeTab, setActiveTab] = useState<Tab>(() => {
|
||||
if (typeof window === "undefined") return "overview"
|
||||
const params = new URLSearchParams(window.location.search)
|
||||
const t = params.get("tab")
|
||||
return t === "settings" || t === "saved" ? (t as Tab) : "overview"
|
||||
})
|
||||
const [profile, setProfile] = useState<{
|
||||
id: string
|
||||
name: string
|
||||
|
||||
Reference in New Issue
Block a user