mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 20:08:07 +08:00
Improved onboarding experience and also redirect to onboarding after revalidating saved session if needed
This commit is contained in:
parent
90e60250cd
commit
49aa0cb5a6
4 changed files with 75 additions and 13 deletions
|
@ -18,10 +18,17 @@ export default function Revalidation() {
|
|||
setState("Previous session found");
|
||||
TokenRefresh().then(async (response) => {
|
||||
if (response[0]) {
|
||||
await dispatch(setUser(await UserInfo()));
|
||||
await setTimeout(() => {
|
||||
navigation.navigate("Home");
|
||||
}, 700);
|
||||
let user_info = await UserInfo();
|
||||
await dispatch(setUser(user_info));
|
||||
if (!(user_info.year_level || user_info.course || user_info.semester)) {
|
||||
await setTimeout(() => {
|
||||
navigation.navigate("Onboarding");
|
||||
}, 700);
|
||||
} else {
|
||||
await setTimeout(() => {
|
||||
navigation.navigate("Home");
|
||||
}, 700);
|
||||
}
|
||||
} else {
|
||||
await setState("Session expired");
|
||||
await setTimeout(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue