In ProjectNav bar last selected tab will be shown when we refresh the page.
This commit is contained in:
parent
94962ef7a6
commit
6c571e62da
@ -47,9 +47,10 @@ const ProjectDetails = () => {
|
||||
refetch,
|
||||
} = useProjectDetails(projectId);
|
||||
|
||||
const [activePill, setActivePill] = useState("profile");
|
||||
|
||||
|
||||
// const [activePill, setActivePill] = useState("profile");
|
||||
const [activePill, setActivePill] = useState(() => {
|
||||
return localStorage.getItem("lastActiveProjectTab") || "profile";
|
||||
});
|
||||
|
||||
const handler = useCallback(
|
||||
(msg) => {
|
||||
@ -65,9 +66,11 @@ const ProjectDetails = () => {
|
||||
return () => eventBus.off("project", handler);
|
||||
}, [handler]);
|
||||
|
||||
const handlePillClick = (pillKey) => {
|
||||
setActivePill(pillKey);
|
||||
};
|
||||
const handlePillClick = (pillKey) => {
|
||||
setActivePill(pillKey);
|
||||
localStorage.setItem("lastActiveProjectTab", pillKey); // ✅ Save to localStorage
|
||||
};
|
||||
|
||||
|
||||
const renderContent = () => {
|
||||
if (projectLoading || !projects_Details) return <Loader />;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user