Skip to content

Commit

Permalink
Merge pull request #43 from Rushikesh-Sonawane99/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #Ps-1265 chore: Added check for accessing userId from localStorage
  • Loading branch information
itsvick authored Jul 24, 2024
2 parents 7eccea4 + 81c39f8 commit a764508
Show file tree
Hide file tree
Showing 2 changed files with 1,078 additions and 1,072 deletions.
9 changes: 8 additions & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ const Header: React.FC = () => {
const { t } = useTranslation();
const pathname = usePathname();
const theme = useTheme<any>();
const userId = localStorage.getItem('userId');
const [userId, setUserId] = React.useState<string>('');

useEffect(() => {
if (typeof window !== 'undefined' && window.localStorage) {
const storedUserId = localStorage.getItem('userId') as string;
setUserId(storedUserId);
}
}, []);

const StyledMenu = styled((props: MenuProps) => (
<Menu
Expand Down
Loading

0 comments on commit a764508

Please sign in to comment.