mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init coursechapter + elements interface
This commit is contained in:
parent
f492baf276
commit
19b7dd650e
16 changed files with 542 additions and 75 deletions
|
|
@ -34,11 +34,15 @@ const AuthProvider = (props: any) => {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(mvp) : fix performance issues > no need to check auth on every render
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!auth.isAuthenticated) {
|
||||
if (auth.isLoading) {
|
||||
checkAuth();
|
||||
}
|
||||
return () => {
|
||||
auth.isLoading = false;
|
||||
}
|
||||
}, []);
|
||||
|
||||
return <AuthContext.Provider value={auth}>{props.children}</AuthContext.Provider>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue