mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 20:08:07 +08:00
Overhauled redux states and separated auth state from user info state
This commit is contained in:
parent
acfb28ce3c
commit
9a246b45e1
6 changed files with 65 additions and 37 deletions
|
@ -7,7 +7,8 @@ import { colors } from "../../styles";
|
|||
import { useEffect, useState } from "react";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { RootDrawerParamList } from "../../interfaces/Interfaces";
|
||||
import { setUser } from "../../features/redux/slices/AuthSlice/AuthSlice";
|
||||
import { login } from "../../features/redux/slices/AuthSlice/AuthSlice";
|
||||
import { setUser } from "../../features/redux/slices/UserSlice/UserSlice";
|
||||
import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer";
|
||||
|
||||
export default function Revalidation() {
|
||||
|
@ -19,7 +20,8 @@ export default function Revalidation() {
|
|||
TokenRefresh().then(async (response) => {
|
||||
let user_info = await UserInfo();
|
||||
if (response && user_info[0]) {
|
||||
await dispatch(setUser(user_info));
|
||||
dispatch(login());
|
||||
dispatch(setUser(user_info));
|
||||
if (
|
||||
!(
|
||||
user_info[1].year_level ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue