account tab fix

This commit is contained in:
Alex Holliday committed 2026-02-10 23:24:51 +00:00
1 parent 71f3c90472
commit 442fc2ce22
2 files changed
+117 -205

No files matched your search

+6 -1
View File
@@ -1,5 +1,5 @@
import { BasePage, Tabs, Tab } from "@/Components/v2/design-elements";
import { useState } from "react";
import { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { TabProfile } from "./TabProfile";
import { TabPassword } from "./TabPassword";
@@ -19,6 +19,11 @@ const Account = ({ open = "profile" }: AccountProps) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState<number>(TAB_MAP[open]);
// Sync activeTab when open prop changes (e.g., navigating from sidebar)
useEffect(() => {
setActiveTab(TAB_MAP[open]);
}, [open]);
return (
<BasePage>
<Tabs