Skip to content

Commit d9c3b1e

Browse files
committed
fix: fix lint problems
1 parent 24292d8 commit d9c3b1e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/ui/auth/AuthProvider.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ import { getUserInfo } from '../services/auth';
99
// isLoading: boolean;
1010
// }
1111

12-
const AuthContext = createContext(undefined);
12+
interface AuthContextType {
13+
user: any;
14+
setUser: React.Dispatch<any>;
15+
refreshUser: () => Promise<void>;
16+
isLoading: boolean;
17+
}
1318

14-
export const AuthProvider = ({ children }) => {
15-
const [user, setUser] = useState(null);
19+
const AuthContext = createContext<AuthContextType | undefined>(undefined);
20+
21+
export const AuthProvider: React.FC<React.PropsWithChildren<object>> = ({ children }) => {
22+
const [user, setUser] = useState<any>(null);
1623
const [isLoading, setIsLoading] = useState(true);
1724

1825
const refreshUser = async () => {

src/ui/components/Navbars/DashboardNavbarLinks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { UserData } from '../../../types/models';
2020

2121
const useStyles = makeStyles(styles);
2222

23-
const DashboardNavbarLinks: React.FC = () => {
23+
export const DashboardNavbarLinks: React.FC = () => {
2424
const classes = useStyles();
2525
const navigate = useNavigate();
2626
const [openProfile, setOpenProfile] = useState<HTMLElement | null>(null);

src/ui/views/Login/Login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Login: React.FC = () => {
6464
window.sessionStorage.setItem('git.proxy.login', 'success');
6565
setMessage('Success!');
6666
setSuccess(true);
67-
refreshUser();
67+
refreshUser().then(() => navigate('/dashboard/repo'));
6868
})
6969
.catch((error: AxiosError) => {
7070
if (error.response?.status === 307) {

0 commit comments

Comments
 (0)