Skip to content

Commit

Permalink
Reset localstorage on fresh login (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored May 11, 2022
1 parent bf265c1 commit 29ea39b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/client/src/app/layout/SidebarApp/SidebarApp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { NavLink, useHistory, useLocation } from "react-router-dom";
import { useTranslation } from "react-i18next";
import {
Expand Down Expand Up @@ -67,6 +67,14 @@ export const SidebarApp: React.FC = () => {
const [selectedPersona, setSelectedPersona] = useLocalStorageContext(
LocalStorageKey.selectedPersona
);

useEffect(() => {
if (!selectedPersona) {
history.push("/");
setSelectedPersona("Developer");
}
}, []);

const [isDevIcon, setDevIcon] = React.useState(true);

const Navigation = (
Expand Down

0 comments on commit 29ea39b

Please # to comment.